← All code files

Dockerfile (Python)

Slim Python image with cached pip layer.

FROM python:3.12-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "main.py"]

About this tool

Slim Python image with cached pip layer.

Ready-to-use Dockerfile (Python) — view the content, copy it, or download it with the correct filename. Free and 100% in your browser.