-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (26 loc) · 879 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
FROM node:16.15.0-slim as static-build
WORKDIR /usr/src
COPY package* .
RUN npm install
COPY static ./static
COPY webpack.config.js .
RUN npx webpack --mode=production
FROM python:3.12-slim as python-build
WORKDIR /usr/src
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential
ADD pyproject.toml poetry.lock /usr/src/
RUN pip install poetry
RUN poetry config virtualenvs.in-project true
RUN poetry install --no-ansi --without playwright,dev && rm pyproject.toml poetry.lock
FROM python:3.12-slim
WORKDIR /app
COPY --from=python-build /usr/src /app
COPY --from=static-build /usr/src/dist/js /opt/app/static/js
ADD ./example_app /app/example_app
RUN addgroup --gid 1000 app
RUN adduser app -h /app -u 1000 -G app -DH
USER 1000
EXPOSE 8000
ENTRYPOINT [".venv/bin/python", "-m", "example_app", "run", "--debug", "--log-level", "debug"]