-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (19 loc) · 719 Bytes
/
Dockerfile
File metadata and controls
31 lines (19 loc) · 719 Bytes
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
FROM python:3.11.4-buster as base
# Perform common operations, dependency installations etc...
RUN apt-get update
ENV PORT=80
EXPOSE $PORT
ENV PATH="/root/.local/bin:$PATH"
RUN curl -sSL https://install.python-poetry.org | python3 -
WORKDIR /app/todo_app
COPY pyproject.toml poetry.lock /app/todo_app/
FROM base as production
# Configure for production
RUN poetry install --without dev
COPY todo_app todo_app
ENTRYPOINT poetry run gunicorn --bind 0.0.0.0:$PORT "todo_app.app:create_app()"
FROM base as development
RUN poetry install
ENTRYPOINT [ "/bin/bash", "-c", "poetry run flask run --host=0.0.0.0 --port=$PORT" ]
#ENTRYPOINT poetry run flask run --host=0.0.0.0 --port=$PORT
# Configure for development