Init commit
Publish Docker image / build-and-push (push) Failing after 2m17s

This commit is contained in:
2025-07-07 13:07:26 +07:00
commit d2e6aa1d38
22 changed files with 4840 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# Stage 1: Build React frontend
FROM node:18-alpine as frontend-builder
WORKDIR /app/frontend
# Copy package config and install dependencies
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
# Copy rest of the frontend code and build
COPY frontend/ .
RUN npm run build
# Stage 2: Setup Node.js backend and serve everything
FROM node:18-alpine
WORKDIR /app
# Copy backend package config and install production dependencies
COPY backend/package.json backend/package-lock.json* ./
RUN npm install --omit=dev
# Copy rest of the backend code
COPY backend/ .
# Copy built frontend assets from the previous stage
COPY --from=frontend-builder /app/frontend/dist ./public
# The port the backend runs on
EXPOSE 3001
# Start the server
CMD ["node", "server.js"]