diff --git a/Dockerfile b/Dockerfile index 62945e1c0c2e248bb7a4e6bd54bfd88032848a41..cca5a45d08d54f6d4054069effc9288789a4a461 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ -FROM python:3.9-slim-bullseye AS base +FROM python:3.10-slim-bullseye AS base +ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED=1 WORKDIR /steering -COPY requirements.txt . +COPY poetry.lock pyproject.toml ./ RUN apt-get update && apt-get install -y libmagic1 curl graphviz -RUN pip install --upgrade pip setuptools -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install poetry==1.2.1 +RUN poetry install EXPOSE 8000 @@ -16,10 +17,10 @@ EXPOSE 8000 FROM base AS dev VOLUME ["/steering"] -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000" ] +CMD ["poetry", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"] FROM base AS prod COPY . . -CMD ["sh", "-c", "gunicorn -b 0.0.0.0:8000 -w $(nproc) steering.wsgi"] +CMD ["poetry", "run", "gunicorn", "-b", "0.0.0.0:8000", "-w", "$(nproc)", "steering.wsgi"]