Skip to content
Snippets Groups Projects
Commit c347fb02 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Use Poetry, update base Python image

parent a40eab27
No related branches found
No related tags found
No related merge requests found
FROM python:3.9-slim-bullseye AS base FROM python:3.10-slim-bullseye AS base
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
WORKDIR /steering WORKDIR /steering
COPY requirements.txt . COPY poetry.lock pyproject.toml ./
RUN apt-get update && apt-get install -y libmagic1 curl graphviz RUN apt-get update && apt-get install -y libmagic1 curl graphviz
RUN pip install --upgrade pip setuptools RUN pip install poetry==1.2.1
RUN pip install --no-cache-dir -r requirements.txt RUN poetry install
EXPOSE 8000 EXPOSE 8000
...@@ -16,10 +17,10 @@ EXPOSE 8000 ...@@ -16,10 +17,10 @@ EXPOSE 8000
FROM base AS dev FROM base AS dev
VOLUME ["/steering"] 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 FROM base AS prod
COPY . . 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"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment