-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 1 KB
/
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
34
35
36
37
38
FROM python:3.10-slim AS python-venv-image
RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential gcc
RUN python -m venv /app/venv
# Make sure we use the virtualenv:
ENV PATH="/app/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install -r requirements.txt
FROM node:16 AS build-nodejs-image
WORKDIR /app
COPY src/web /app/src/web/
COPY src/web/src/config.ts.prod /app/src/web/src/config.ts
RUN cd src/web && yarn install && npx browserslist@latest --update-db && yarn run build
FROM python:3.10-slim
RUN apt-get update && apt-get install -y --no-install-recommends nginx && apt-get clean
WORKDIR /app
ENV PATH="/app/venv/bin:$PATH"
COPY tools/nginx.conf /app
COPY --from=python-venv-image /app/venv /app/venv
COPY --from=build-nodejs-image /app/src/web/dist /app/static
COPY src/dimsum /app
COPY logging.json /app
COPY dimsum.conf /app
COPY ssh_host_key /app
COPY ssh_host_key.pub /app
ADD ./tools/startup.sh /app/startup.sh
RUN chmod u+x /app/startup.sh
ENTRYPOINT [ "/app/startup.sh" ]