Skip to content

Commit 9eb8273

Browse files
Resolve docker build warnings
1 parent cede31c commit 9eb8273

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim as base
1+
FROM python:3.9-slim AS base
22

33
# Set up poetry
44
ENV POETRY_HOME="/opt/poetry"
@@ -12,22 +12,22 @@ RUN curl -sSL https://install.python-poetry.org | python3 -
1212
# Install dependencies
1313
WORKDIR /app
1414
COPY poetry.lock pyproject.toml /app/
15-
RUN poetry install --no-interaction --no-ansi
15+
RUN poetry config virtualenvs.create false --local && poetry install --no-interaction --no-ansi
1616

1717
COPY todo_app /app/todo_app
1818

1919
EXPOSE 8000
2020

21-
FROM base as test
21+
FROM base AS test
2222

23-
ENTRYPOINT poetry run pytest
23+
ENTRYPOINT ["poetry", "run", "pytest"]
2424

25-
FROM base as production
25+
FROM base AS production
2626

2727
ENV FLASK_DEBUG=false
28-
CMD poetry run gunicorn --bind 0.0.0.0 "todo_app.app:create_app()"
28+
CMD ["poetry", "run", "gunicorn", "--bind", "0.0.0.0", "todo_app.app:create_app()"]
2929

30-
FROM base as development
30+
FROM base AS development
3131

3232
ENV FLASK_DEBUG=true
33-
CMD poetry run gunicorn --bind 0.0.0.0 "todo_app.app:create_app()"
33+
CMD ["poetry", "run", "gunicorn", "--bind", "0.0.0.0", "todo_app.app:create_app()"]

0 commit comments

Comments
 (0)