Files
Christian Krakau-Louis ae8ec413d3 feat: serve app with gunicorn
2026-05-17 16:45:19 +02:00

35 lines
943 B
Docker

# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory to /app
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libavcodec-extra \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy only necessary application files
# The .dockerignore file ensures we only include what's specified
COPY musicround/ ./musicround/
COPY migrations/ ./migrations/
COPY run_migration.py run.py wsgi.py docker-entrypoint.sh LICENSE favicon.ico .
# Make the entrypoint script executable
RUN chmod +x docker-entrypoint.sh
# Create necessary directories and ensure proper permissions
RUN mkdir -p /data && chmod 777 /data
# Set environment variables
ENV PYTHONPATH=/app
ENV FLASK_APP=run.py
# Use the entrypoint script
CMD ["./docker-entrypoint.sh"]