add backend
Build and Deploy / build-and-deploy (push) Failing after 5m26s

This commit is contained in:
2026-05-03 20:58:09 +02:00
parent f3dfdb2f90
commit d9e3f398b8
8 changed files with 3722 additions and 484 deletions
+17 -10
View File
@@ -1,19 +1,26 @@
# Shared build: generates /dist (Astro site + admin SPA) and tina/__generated__
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY package*.json ./
RUN npm ci --legacy-peer-deps
COPY . .
RUN npm run build
FROM nginx:alpine
ENV TINA_PUBLIC_IS_LOCAL=true
RUN npm run build:tina
# Frontend: Nginx serving the static site + TinaCMS admin SPA
FROM nginx:alpine AS frontend
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# Backend: TinaCMS self-hosted API server
FROM node:20-alpine AS backend
WORKDIR /app
COPY package*.json ./
RUN npm ci --legacy-peer-deps --omit=dev
COPY backend/ ./backend/
COPY --from=builder /app/tina/__generated__ ./tina/__generated__
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "backend/index.js"]