From 55bcb7336bd5586370a813f1747d91b39be219a9 Mon Sep 17 00:00:00 2001 From: profit Date: Fri, 13 Mar 2026 19:14:48 -0700 Subject: [PATCH] Add Dockerfile for Coolify deployment Multi-stage build: Node for React frontend, Python slim for Flask + gunicorn. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..779c255 --- /dev/null +++ b/Dockerfile @@ -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"]