23 lines
674 B
Docker
23 lines
674 B
Docker
# Use an official Python runtime as a parent image
|
|
FROM python:3.11-slim-bullseye
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV APP_HOME=/app
|
|
WORKDIR $APP_HOME
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
RUN pip install gunicorn
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Tell Docker that the container listens on port 80
|
|
EXPOSE 80
|
|
|
|
# Run the application using Gunicorn
|
|
# This command runs the Flask app. 'app:app' means "in the file named app.py, run the variable named app".
|
|
# Adjust if your main file or Flask app variable is named differently.
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:app"] |