25 lines
651 B
Docker
25 lines
651 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
NIXPACKS_POETRY_VERSION=2.2.1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends build-essential curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN python -m venv --copies /opt/venv
|
|
ENV VIRTUAL_ENV=/opt/venv
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
COPY . .
|
|
|
|
RUN pip install --no-cache-dir poetry==$NIXPACKS_POETRY_VERSION \
|
|
&& poetry install --no-interaction --no-ansi
|
|
|
|
ENV PORT=8000
|
|
|
|
CMD ["sh", "-c", "poetry run python manage.py collectstatic --noinput && poetry run python -m gunicorn geo.wsgi:application --bind 0.0.0.0:${PORT:-8000}"]
|