forked from microsoft/sample-app-aoai-chatGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebApp.Dockerfile
33 lines (29 loc) · 994 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
32
33
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
ENV UWSGI_PROCESSES=2
ENV UWSGI_THREADS=1
EXPOSE 80
CMD uwsgi --processes $UWSGI_PROCESSES --threads $UWSGI_THREADS --http :80 --wsgi-file app.py --callable app -b 32768