Files
vending-machine-game/Dockerfile
T
Hamed fbfa8d011d
CI/CD / test (push) Successful in 1m15s
CI/CD / publish (push) Successful in 1m21s
CI/CD / deploy (push) Successful in 6s
docs: document React architecture and enforce migration checks in CI
2026-10-28 12:53:12 +03:30

16 lines
679 B
Docker

# Stage 1: run the tests and build the static game with Vite.
FROM node:22-alpine AS build
WORKDIR /app
# Override with a reachable mirror where registry.npmjs.org is blocked (docker compose passes NPM_REGISTRY).
ARG NPM_REGISTRY=https://registry.npmjs.org/
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund --registry="$NPM_REGISTRY" --fetch-retries=3 --fetch-timeout=60000
COPY . .
RUN npm run format:check && npm run lint && npm test && npm run build
# Stage 2: serve dist/ with Caddy, which also obtains and renews the HTTPS certificate.
FROM caddy:2.8.4-alpine
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist /srv
EXPOSE 80 443 443/udp