forked from microsoft/sample-app-aoai-chatGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebApp.Dockerfile
31 lines (27 loc) · 928 Bytes
/
WebApp.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:20-alpine AS frontend
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY ./frontend/package*.json ./
USER node
RUN npm ci
COPY --chown=node:node ./frontend/ ./frontend
COPY --chown=node:node ./static/ ./static
WORKDIR /home/node/app/frontend
RUN npm run build
FROM python:3.11-alpine
RUN apk add --no-cache --virtual .build-deps \
build-base \
libffi-dev \
openssl-dev \
curl \
&& apk add --no-cache \
libpq \
&& pip install --no-cache-dir uwsgi
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \
&& rm -rf /root/.cache
COPY . /usr/src/app/
COPY --from=frontend /home/node/app/static /usr/src/app/static/
WORKDIR /usr/src/app
EXPOSE 80
CMD ["uwsgi", "--http", ":80", "--wsgi-file", "app.py", "--callable", "app", "-b","32768"]