-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
37 lines (26 loc) · 1.05 KB
/
dockerfile
File metadata and controls
37 lines (26 loc) · 1.05 KB
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
FROM python:3.10.12 AS base
WORKDIR /code
ARG POETRY_VERSION=2.3.1
RUN pip install --no-cache-dir "poetry==${POETRY_VERSION}"
COPY pyproject.toml poetry.lock /code/
RUN poetry sync --no-root --without dev
COPY ./app.py /code/app.py
COPY ./assets /code/assets
COPY ./pages /code/pages
COPY ./util /code/util
COPY ./components /code/components
COPY ./renderer /code/renderer
COPY ./model /code/model
FROM base AS tests
RUN apt-get update && apt-get install -y chromium chromium-driver
RUN poetry sync --no-root --with dev
COPY ./tests /code/tests
CMD ["poetry", "run", "pytest", "--headless"]
FROM base AS prod
#=== Select ONE Appropriate Run Command [edit with: nano dockerfile] ===
# For Test Server, with Debug Capabilities in Browser
CMD ["poetry", "run", "python", "app.py"]
# For Test Server, with Gunicorn
# CMD ["poetry", "run", "gunicorn", "--workers", "1", "--bind", "0.0.0.0:8080", "app:server"]
# For PRODUCTION Server, (needs enough RAM and CPU cores!)
# CMD ["poetry", "run", "gunicorn", "--workers", "32", "--bind", "0.0.0.0:8080", "app:server"]