Files
gomoku/client/Dockerfile
T
tiennm99 b2be88597c feat(docker): multi-stage Dockerfiles and compose for server + nginx client
- server/Dockerfile: golang:1.23-alpine build → distroless/static-debian12:nonroot (3.5 MB)
- client/Dockerfile: node:22-alpine Vite build → nginx:1.27-alpine runtime
- client/nginx.conf: SPA fallback, aggressive asset caching, gzip
- docker-compose.yml: two services — server :1999, client :8080
- server/.dockerignore / client/.dockerignore: trim build contexts
- server/Makefile: add docker-build/run/stop/logs/smoke targets
- client/vite.config.js: raise chunkSizeWarningLimit to 2000 (Phaser bundle)
- remove server/docker-compose.yaml (superseded by root compose file)
2026-04-11 15:28:15 +07:00

23 lines
553 B
Docker

# syntax=docker/dockerfile:1.7
# Build stage: Vite production build
# Uses pre-committed src/generated/protocol.js — no protoc needed here
FROM node:22-alpine AS build
WORKDIR /src
# Cache npm install separately from source changes
COPY package.json package-lock.json ./
RUN npm ci
COPY index.html vite.config.js ./
COPY src src
RUN npm run build
# Runtime stage: nginx serves static assets from dist/
FROM nginx:1.27-alpine AS runtime
COPY --from=build /src/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080