Files
mc-computer-craft-api-frontend/Dockerfile
T
johannesbot 76c2258cfc
Build and Deploy / build (push) Failing after 8s
Build and Deploy / deploy (push) Has been skipped
test
2026-05-29 19:54:07 +02:00

28 lines
713 B
Docker

# ---- Build stage -----------------------------------------------------
FROM node:22-alpine AS build
WORKDIR /app
# Backend URLs are baked in at build time (Vite inlines VITE_* variables).
ARG VITE_API_BASE=https://localhost:3000
ARG VITE_WS_BASE
ENV VITE_API_BASE=$VITE_API_BASE
ENV VITE_WS_BASE=$VITE_WS_BASE
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Production stage
FROM nginx:stable-alpine as production-stage
# Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
# Copy built files
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]