mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 02:41:09 +02:00
Migrate 17 app Dockerfiles from standalone builds (each copying 20+ packages individually) to use the shared sveltekit-base:local image. Benefits: - No more missing package COPY errors - Single base image to maintain - Consistent build pattern across all apps - Faster builds (shared deps pre-installed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
1.1 KiB
Docker
31 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM sveltekit-base:local AS builder
|
|
|
|
ARG PUBLIC_BACKEND_URL=http://mana-auth
|
|
ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-auth:3001
|
|
ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL
|
|
ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL
|
|
|
|
COPY apps/skilltree/apps/web ./apps/skilltree/apps/web
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
|
pnpm install --no-frozen-lockfile --ignore-scripts
|
|
|
|
WORKDIR /app/apps/skilltree/apps/web
|
|
RUN pnpm exec svelte-kit sync
|
|
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm build
|
|
|
|
FROM node:20-alpine AS production
|
|
WORKDIR /app/apps/skilltree/apps/web
|
|
COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm
|
|
COPY --from=builder /app/apps/skilltree/apps/web/node_modules ./node_modules
|
|
COPY --from=builder /app/apps/skilltree/apps/web/build ./build
|
|
COPY --from=builder /app/apps/skilltree/apps/web/package.json ./
|
|
|
|
EXPOSE 5021
|
|
ENV NODE_ENV=production PORT=5021 HOST=0.0.0.0
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:5021/health || exit 1
|
|
|
|
CMD ["node", "build"]
|