feat: setup docker, backend, and gitea pipeline for production
All checks were successful
Build and Deploy / build-and-push (push) Successful in 4m19s

This commit is contained in:
Cauê Faleiros
2026-02-23 15:21:28 -03:00
parent 3250ad7537
commit 28c75bbe13
11 changed files with 425 additions and 8 deletions

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
# Stage 1: Build Frontend
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json ./
# In a real scenario, copy package-lock.json too
# COPY package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Production Runtime
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY package.json ./
COPY backend/package.json ./backend/
# Install dependencies (including production deps for backend)
RUN npm install --omit=dev
# Copy backend source
COPY backend/ ./backend/
# Copy built frontend from builder stage
COPY --from=builder /app/dist ./dist
EXPOSE 3001
CMD ["node", "backend/index.js"]