Writing a production Dockerfile

Dockerfile present · docker.dockerfile

Why it matters

A Dockerfile makes the runtime reproducible: the image you tested is the image that runs. For a library this check does not apply — DevOps Check detects the repository type first.

How to fix it

What to do: Create a Dockerfile in the project root.

FROM python:3.12-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Do not run as root!
RUN useradd -m appuser && chown -R appuser /app
USER appuser

EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

Does your repository pass this check?

Free for public GitHub repositories, no account needed. 50+ DevOps and security checks in about ten seconds.

Public repositories where this check fails

Related checks