game-village-politics-frontend/Dockerfile.build

15 lines
760 B
Docker

# Reusable build environment. The source is bind-mounted, not copied.
FROM node:26-slim
WORKDIR /app
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
# Lets pnpm purge a stale bind-mounted node_modules without a TTY prompt.
ENV CI=true
RUN npm install -g --force corepack && corepack enable
# Static SPA build (ssr: false): writes .output/public, the same files a Steam wrapper ships.
CMD ["sh", "-c", "pnpm install --frozen-lockfile && pnpm run generate && find .output -type f -name '*.map' -delete && find .output -type f \\( -name '*.js' -o -name '*.mjs' -o -name '*.css' \\) -exec sed -i -e '/^[[:space:]]*\\/\\/# sourceMappingURL=.*$/d' -e '/^[[:space:]]*\\/\\*# sourceMappingURL=.*\\*\\/[[:space:]]*$/d' {} +"]