admin / Synapse-Cortex
publicSelf Hosted ITSM Tool with RBAC/Tenanting and MFA
Synapse-Cortex / Synapse-Cortexv2 / Dockerfile
1049 B · main
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # Stage 1: build the React SPA. Produces frontend/dist, which the second # stage copies into the Python image so app/main.py's StaticFiles mount + # catch-all route (SPA_DIST_DIR = <repo root>/frontend/dist) find it - this # app has no separate frontend server/port in production, FastAPI serves # the built bundle directly. FROM node:22-alpine AS frontend-build WORKDIR /frontend COPY frontend/package.json frontend/package-lock.json* ./ RUN npm ci COPY frontend . RUN npm run build # Stage 2: the FastAPI app, serving both the JSON API and the built SPA. FROM python:3.11-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends libpq-dev gcc \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app ./app COPY alembic ./alembic COPY alembic.ini . COPY --from=frontend-build /frontend/dist ./frontend/dist EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |