-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (26 loc) · 863 Bytes
/
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
# build Vue frontend
FROM node:18 as builder
COPY ./frontend .
RUN npm install
RUN npm run build
# now we should have a dist folder containing the static website
FROM python:3.11.1-bullseye as pybuilder
WORKDIR /code
COPY ./backend /code/
RUN pip install --user -r requirements.txt
# We get the dependencies with the full python image so we can compile the one with missing binaries
ENV UseRobots=false
FROM python:3.11.1-slim-bullseye as app
# copy the dependencies from the pybuilder
COPY --from=pybuilder /root/.local /root/.local
# copy the backend python files from the pybuilder
COPY --from=pybuilder /code /dist
# copy the frontend static files from the builder
COPY --from=builder ./dist /dist/
WORKDIR /dist
# create dir for save
RUN mkdir save
EXPOSE 5001
ENV PATH=/root/.local/bin:${PATH}
VOLUME /dist/save
ENTRYPOINT ["python", "/dist/server.py"]