22 lines
526 B
Docker
22 lines
526 B
Docker
# Use a slim Python image
|
|
FROM python:3.11-slim
|
|
|
|
# Prevent Python from writing .pyc files and enable unbuffered logging
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Set work directory
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
# We do this before copying the whole app to leverage Docker cache
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Expose the port your app runs on
|
|
EXPOSE 5001
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:5001", "app:app"] |