feat(deploy): CI/CD Gitea Actions + stack Docker prod pour xip.kerboul.me
Some checks failed
Deploy XIP / deploy (push) Failing after 21s
Some checks failed
Deploy XIP / deploy (push) Failing after 21s
- docker-compose.prod.yml: postgres + redis + backend (bun) + web (nginx single-origin) - backend/Dockerfile + entrypoint: prisma migrate deploy + seed idempotent au boot - frontend/Dockerfile: build Vite (VITE_API_URL=https://xip.kerboul.me) servi par nginx - deploy/nginx.conf: proxy /api + /ws vers le backend, SPA fallback - .gitea/workflows/deploy.yml: auto-deploy SSH sur push main (runner CT121 -> CT502) - scripts/deploy.sh: pull + rebuild de la stack - mode open-bar (XIP_OPEN_BAR): paywall off pour tous en prod, via isFree() centralise Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
22
backend/Dockerfile
Normal file
22
backend/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
# XIP backend — Bun + Hono + Prisma.
|
||||
# Build context is the repo ROOT (see docker-compose.prod.yml) so we can copy backend/.
|
||||
FROM oven/bun:1-debian AS deps
|
||||
WORKDIR /app
|
||||
COPY backend/package.json ./
|
||||
RUN bun install
|
||||
|
||||
FROM oven/bun:1-debian AS runtime
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
# Prisma's query engine needs openssl + CA certs (generate downloads it over HTTPS).
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends openssl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY backend/ ./
|
||||
# Generate the Prisma client from the schema (no DB connection required).
|
||||
RUN bunx prisma generate \
|
||||
&& chmod +x docker-entrypoint.sh
|
||||
EXPOSE 3000
|
||||
# Entrypoint applies migrations + seeds (idempotent) then starts the server.
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
Reference in New Issue
Block a user