Add Dockerfile, frontend image, and local compose stack

This commit is contained in:
megaproxy 2026-07-16 23:29:01 +01:00
parent ac72db9925
commit 3e2fbebac7
7 changed files with 199 additions and 1 deletions

22
frontend/Dockerfile Normal file
View file

@ -0,0 +1,22 @@
# Shattered Void MMO - frontend (Vite/React build served by nginx)
FROM node:20-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
# Vite inlines env vars at build time, so the API URL must be known here, not at runtime.
ARG VITE_API_URL=http://localhost:3000
ARG VITE_WS_URL=http://localhost:3000
ENV VITE_API_URL=$VITE_API_URL
ENV VITE_WS_URL=$VITE_WS_URL
RUN npm run build
FROM nginx:1.27-alpine AS runtime
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80