Skip to content

Instantly share code, notes, and snippets.

@lukas-h
Created May 7, 2024 13:01
Show Gist options
  • Save lukas-h/3b944f4aa710271621dd295b7be79ebc to your computer and use it in GitHub Desktop.
Save lukas-h/3b944f4aa710271621dd295b7be79ebc to your computer and use it in GitHub Desktop.
Python PIP Dockerfile
dockerfile
# Use a Python base image matching your project's Python version
FROM python:3.9
# Set the working directory to /app
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the Python code into the container
COPY . .
# Set the command to run when starting the container
CMD ["python", "app.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment