27 lines
1.1 KiB
Docker
27 lines
1.1 KiB
Docker
# The web app on Caddy (Step 13.2, static since CR-014). Build from the repository root:
|
|
# docker build -f deploy/web.Dockerfile --build-arg APP_BUILD=$(git rev-parse --short HEAD) .
|
|
# Caddy serves the built app and gets HTTPS certificates for SITE_ADDRESS
|
|
# automatically.
|
|
|
|
FROM node:24-slim AS build
|
|
RUN corepack enable
|
|
WORKDIR /repo
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
COPY apps/web/package.json apps/web/
|
|
COPY packages/content/package.json packages/content/
|
|
COPY packages/engine/package.json packages/engine/
|
|
COPY packages/schema/package.json packages/schema/
|
|
COPY packages/sim/package.json packages/sim/
|
|
RUN pnpm install --frozen-lockfile --filter "@deadhead/web..."
|
|
COPY tsconfig.base.json ./
|
|
COPY packages packages
|
|
COPY apps/web apps/web
|
|
ARG APP_BUILD=dev
|
|
# The committed map art (public/assets/map-gen) is used as is: the source art
|
|
# isn't in the build context, so the map-art script is not run here.
|
|
RUN APP_BUILD=$APP_BUILD pnpm --filter @deadhead/web exec vite build
|
|
|
|
FROM caddy:2-alpine
|
|
COPY deploy/Caddyfile /etc/caddy/Caddyfile
|
|
COPY --from=build /repo/apps/web/dist /srv
|