Docker for Python
Docker containers ensure consistent environments across development and production.
Basic Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
Docker Compose
version: '3.8'
services:
web:
build: .
ports:
- "8000:8000"
db:
image: postgres:14
Discussion 0
No comments yet. Be the first to start the discussion!
Leave a Comment