feat(docker): Deploy frontend from express

This commit is contained in:
2025-05-29 15:54:19 +02:00
parent 98fdc290f4
commit 58fc2f7acf
3 changed files with 40 additions and 10 deletions

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
# --- Build frontend ---
FROM node:24-slim AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ .
RUN npm run build
# --- Backend setup ---
FROM node:24-slim
# Install ping for backend
RUN apt-get update && \
apt-get install -y iputils-ping && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy backend code
COPY backend/package*.json ./
RUN npm install
COPY backend/ .
# Copy built frontend into backend expected location
COPY --from=frontend-builder /frontend/dist /frontend/dist
EXPOSE 5000
CMD ["node", "index.js"]