diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ddd5b73 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Dockerfile for a Django project + +FROM python:3.12-slim-bookworm + +# The installer requires curl (and certificates) to download the release archive +RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && apt-get install libmagic-dev -y + +# Download the latest installer +ADD https://astral.sh/uv/install.sh /uv-installer.sh + +# Run the installer then remove it +RUN sh /uv-installer.sh && rm /uv-installer.sh + +# Ensure the installed binary is on the `PATH` +ENV PATH="/root/.local/bin/:$PATH" + +ADD . /app + +# Set the working directory to /app +WORKDIR /app + +# Make port 8010 available to the world outside this container +EXPOSE 8010 + +# Define environment variable +ENV DJANGO_SETTINGS_MODULE=config.settings.production +ENV DJANGO_READ_DOT_ENV_FILE=True + +RUN uv sync --frozen --no-dev && uv run manage.py collectstatic --noinput + +# run gunicorn when the container launches +# CMD ["uv", "run", "gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8010"] +CMD ["uv", "run", "manage.py", "runserver", "0.0.0.0:8010"] |