Add Dockerfile for Coolify deployment

Multi-stage build: Node for React frontend, Python slim for Flask + gunicorn.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
profit 2026-03-13 19:14:48 -07:00
parent 3d635b742c
commit 55bcb7336b

31
Dockerfile Normal file
View File

@ -0,0 +1,31 @@
# Stage 1: Build React frontend
FROM node:22-alpine AS frontend
WORKDIR /app/web/frontend
COPY web/frontend/package.json web/frontend/package-lock.json ./
RUN npm ci
COPY web/frontend/ ./
RUN npm run build
# Stage 2: Python app
FROM python:3.12-slim
WORKDIR /app
# Install Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn
# Copy app source
COPY . .
# Copy built frontend from stage 1
COPY --from=frontend /app/web/frontend/dist /app/web/frontend/dist
# Create runtime directories
RUN mkdir -p /app/state/queue /app/media/music /app/media/podcasts /app/media/fallback /app/logs
# Initialize the database
RUN python scripts/init_db.py /app/state/radio.db
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--timeout", "120", "web.app:app"]