Files
fabdash/Dockerfile
T
Jason Stedwell 2776bb1e63
Build and Push Docker Image / build (push) Successful in 16s
Fix build hang: commit lockfile and use npm ci
The pipeline hung on `npm install` because no package-lock.json existed,
forcing a full from-scratch dependency resolve on every build. Commit the
resolved lockfile and switch the Dockerfile to `npm ci` for deterministic,
fast installs. Add .dockerignore to keep the build context small.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 20:37:45 -05:00

31 lines
1.1 KiB
Docker

# ── Stage 1: Build React frontend ────────────────────────────────────────────
FROM node:18-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
# npm ci installs from the committed lockfile: deterministic and far faster
# than a from-scratch resolve. --prefer-offline avoids redundant registry hits.
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit --fund=false
COPY frontend/ ./
RUN npm run build
# ── Stage 2: Flask + Gunicorn production image ────────────────────────────────
FROM python:3.12-slim
WORKDIR /app
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/ ./
# Copy compiled React build into Flask static folder
COPY --from=frontend-build /app/frontend/dist ./app/static
# Persistent data directory for SQLite
RUN mkdir -p /app/data
EXPOSE 8080
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "2", "--timeout", "120", "run:app"]