diff --git a/.github/workflows/cd-macmini.yml b/.github/workflows/cd-macmini.yml index eb27f52f9..ae7d9d227 100644 --- a/.github/workflows/cd-macmini.yml +++ b/.github/workflows/cd-macmini.yml @@ -50,6 +50,7 @@ env: ENV_FILE: .env.macmini DEPLOY_NOTIFY_ROOM_ID: ${{ secrets.DEPLOY_NOTIFY_ROOM_ID }} DEPLOY_NOTIFY_BOT_TOKEN: ${{ secrets.DEPLOY_NOTIFY_BOT_TOKEN }} + DOCKER_BUILDKIT: 1 PATH: /usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin jobs: diff --git a/apps/calendar/apps/backend/Dockerfile b/apps/calendar/apps/backend/Dockerfile index 7c9950be3..b85a15f69 100644 --- a/apps/calendar/apps/backend/Dockerfile +++ b/apps/calendar/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -28,7 +29,7 @@ COPY apps/calendar/packages ./apps/calendar/packages COPY apps/calendar/apps/backend ./apps/calendar/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/calendar/apps/web/Dockerfile b/apps/calendar/apps/web/Dockerfile index 7bd228ab2..56cdad5b0 100644 --- a/apps/calendar/apps/web/Dockerfile +++ b/apps/calendar/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -53,7 +54,7 @@ COPY apps/calendar/packages ./apps/calendar/packages COPY apps/calendar/apps/web ./apps/calendar/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/chat/apps/backend/Dockerfile b/apps/chat/apps/backend/Dockerfile index b67c42310..1ae825eda 100644 --- a/apps/chat/apps/backend/Dockerfile +++ b/apps/chat/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -29,7 +30,7 @@ COPY packages/shared-tsconfig ./packages/shared-tsconfig COPY apps/chat/apps/backend ./apps/chat/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/chat/apps/web/Dockerfile b/apps/chat/apps/web/Dockerfile index 136d19fca..52d8be5b1 100644 --- a/apps/chat/apps/web/Dockerfile +++ b/apps/chat/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -46,7 +47,7 @@ COPY apps/chat/packages ./apps/chat/packages COPY apps/chat/apps/web ./apps/chat/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/clock/apps/backend/Dockerfile b/apps/clock/apps/backend/Dockerfile index be7dbe5eb..5f924ab9a 100644 --- a/apps/clock/apps/backend/Dockerfile +++ b/apps/clock/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -27,7 +28,7 @@ COPY apps/clock/packages ./apps/clock/packages COPY apps/clock/apps/backend ./apps/clock/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/clock/apps/web/Dockerfile b/apps/clock/apps/web/Dockerfile index 5bc0ce24c..ca27eed02 100644 --- a/apps/clock/apps/web/Dockerfile +++ b/apps/clock/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -46,7 +47,7 @@ COPY apps/clock/packages ./apps/clock/packages COPY apps/clock/apps/web ./apps/clock/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/contacts/apps/backend/Dockerfile b/apps/contacts/apps/backend/Dockerfile index 0639fce95..463ac9869 100644 --- a/apps/contacts/apps/backend/Dockerfile +++ b/apps/contacts/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -26,7 +27,7 @@ COPY packages/shared-tsconfig ./packages/shared-tsconfig COPY apps/contacts/apps/backend ./apps/contacts/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/contacts/apps/web/Dockerfile b/apps/contacts/apps/web/Dockerfile index 293c8937d..171f2be9d 100644 --- a/apps/contacts/apps/web/Dockerfile +++ b/apps/contacts/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -50,7 +51,7 @@ COPY packages/shared-stores ./packages/shared-stores COPY apps/contacts/apps/web ./apps/contacts/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/manacore/apps/web/Dockerfile b/apps/manacore/apps/web/Dockerfile index 1c1c5d485..50b3738c0 100644 --- a/apps/manacore/apps/web/Dockerfile +++ b/apps/manacore/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -48,7 +49,7 @@ COPY packages/wallpaper-generator ./packages/wallpaper-generator COPY apps/manacore/apps/web ./apps/manacore/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/manadeck/apps/backend/Dockerfile b/apps/manadeck/apps/backend/Dockerfile index 720dfcf89..38b6daeba 100644 --- a/apps/manadeck/apps/backend/Dockerfile +++ b/apps/manadeck/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -26,7 +27,7 @@ COPY packages/shared-nestjs-setup ./packages/shared-nestjs-setup COPY apps/manadeck/apps/backend ./apps/manadeck/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/matrix/apps/web/Dockerfile b/apps/matrix/apps/web/Dockerfile index a8eb87a65..1710b35d9 100644 --- a/apps/matrix/apps/web/Dockerfile +++ b/apps/matrix/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -34,7 +35,7 @@ COPY packages/shared-utils ./packages/shared-utils COPY apps/matrix/apps/web ./apps/matrix/apps/web # Install dependencies (--no-frozen-lockfile due to workspace overrides) -RUN pnpm install --no-frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --no-frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-auth diff --git a/apps/mukke/apps/backend/Dockerfile b/apps/mukke/apps/backend/Dockerfile index 9b678a310..0f927e994 100644 --- a/apps/mukke/apps/backend/Dockerfile +++ b/apps/mukke/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -28,7 +29,7 @@ COPY apps/mukke/packages ./apps/mukke/packages COPY apps/mukke/apps/backend ./apps/mukke/apps/backend # Install dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages WORKDIR /app/packages/shared-errors diff --git a/apps/mukke/apps/web/Dockerfile b/apps/mukke/apps/web/Dockerfile index 1c086f685..817d3e2cb 100644 --- a/apps/mukke/apps/web/Dockerfile +++ b/apps/mukke/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -49,7 +50,7 @@ COPY apps/mukke/packages ./apps/mukke/packages COPY apps/mukke/apps/web ./apps/mukke/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/nutriphi/apps/backend/Dockerfile b/apps/nutriphi/apps/backend/Dockerfile index 474a9261f..8e5999240 100644 --- a/apps/nutriphi/apps/backend/Dockerfile +++ b/apps/nutriphi/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -26,7 +27,7 @@ COPY apps/nutriphi/packages ./apps/nutriphi/packages COPY apps/nutriphi/apps/backend ./apps/nutriphi/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first WORKDIR /app/packages/shared-nestjs-auth diff --git a/apps/nutriphi/apps/web/Dockerfile b/apps/nutriphi/apps/web/Dockerfile index 8f3646a44..2ed387a50 100644 --- a/apps/nutriphi/apps/web/Dockerfile +++ b/apps/nutriphi/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -46,7 +47,7 @@ COPY apps/nutriphi/packages ./apps/nutriphi/packages COPY apps/nutriphi/apps/web ./apps/nutriphi/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-auth diff --git a/apps/photos/apps/backend/Dockerfile b/apps/photos/apps/backend/Dockerfile index 6cc5b264b..a7c7eac04 100644 --- a/apps/photos/apps/backend/Dockerfile +++ b/apps/photos/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -29,7 +30,7 @@ COPY apps/photos/packages/shared ./apps/photos/packages/shared COPY apps/photos/apps/backend ./apps/photos/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/photos/apps/web/Dockerfile b/apps/photos/apps/web/Dockerfile index 8d500b1e0..a44c95806 100644 --- a/apps/photos/apps/web/Dockerfile +++ b/apps/photos/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -55,7 +56,7 @@ COPY apps/photos/packages/shared ./apps/photos/packages/shared COPY apps/photos/apps/web ./apps/photos/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/picture/apps/backend/Dockerfile b/apps/picture/apps/backend/Dockerfile index 482e57c0a..788bb1c2d 100644 --- a/apps/picture/apps/backend/Dockerfile +++ b/apps/picture/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -28,7 +29,7 @@ COPY packages/shared-nestjs-setup ./packages/shared-nestjs-setup COPY apps/picture/apps/backend ./apps/picture/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/picture/apps/web/Dockerfile b/apps/picture/apps/web/Dockerfile new file mode 100644 index 000000000..6a27d43bf --- /dev/null +++ b/apps/picture/apps/web/Dockerfile @@ -0,0 +1,97 @@ +# syntax=docker/dockerfile:1 +# Build stage +FROM node:20-alpine AS builder + +# Build arguments for SvelteKit static env vars +ARG PUBLIC_BACKEND_URL=http://picture-backend:3040 +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + +# Install pnpm +RUN corepack enable && corepack prepare pnpm@9.15.0 --activate + +WORKDIR /app + +# Copy root workspace files +COPY pnpm-workspace.yaml ./ +COPY package.json ./ +COPY pnpm-lock.yaml ./ + +# Copy shared packages needed by picture web +COPY packages/shared-types ./packages/shared-types +COPY packages/shared-auth ./packages/shared-auth +COPY packages/shared-auth-ui ./packages/shared-auth-ui +COPY packages/shared-branding ./packages/shared-branding +COPY packages/shared-feedback-service ./packages/shared-feedback-service +COPY packages/shared-feedback-types ./packages/shared-feedback-types +COPY packages/shared-feedback-ui ./packages/shared-feedback-ui +COPY packages/shared-i18n ./packages/shared-i18n +COPY packages/shared-icons ./packages/shared-icons +COPY packages/shared-tailwind ./packages/shared-tailwind +COPY packages/shared-theme ./packages/shared-theme +COPY packages/shared-theme-ui ./packages/shared-theme-ui +COPY packages/shared-subscription-types ./packages/shared-subscription-types +COPY packages/shared-subscription-ui ./packages/shared-subscription-ui +COPY packages/shared-profile-ui ./packages/shared-profile-ui +COPY packages/shared-ui ./packages/shared-ui +COPY packages/shared-utils ./packages/shared-utils +COPY packages/shared-vite-config ./packages/shared-vite-config +COPY packages/shared-api-client ./packages/shared-api-client +COPY packages/shared-stores ./packages/shared-stores +COPY packages/shared-pwa ./packages/shared-pwa + +# Copy picture packages +COPY apps/picture/packages/shared ./apps/picture/packages/shared +COPY apps/picture/packages/design-tokens ./apps/picture/packages/design-tokens + +# Copy picture web +COPY apps/picture/apps/web ./apps/picture/apps/web + +# Install dependencies +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile + +# Build shared packages that need building +WORKDIR /app/packages/shared-vite-config +RUN pnpm build + +WORKDIR /app/packages/shared-auth +RUN pnpm build || true + +# Build the web app +WORKDIR /app/apps/picture/apps/web +RUN pnpm exec svelte-kit sync +RUN pnpm build + +# Production stage +FROM node:20-alpine AS production + +# Keep same directory structure as builder so pnpm symlinks resolve correctly +WORKDIR /app/apps/picture/apps/web + +# Copy the pnpm store that symlinks point to (at /app/node_modules/.pnpm) +COPY --from=builder /app/node_modules/.pnpm /app/node_modules/.pnpm + +# Copy the app's node_modules (contains symlinks to the pnpm store) +COPY --from=builder /app/apps/picture/apps/web/node_modules ./node_modules + +# Copy built application +COPY --from=builder /app/apps/picture/apps/web/build ./build +COPY --from=builder /app/apps/picture/apps/web/package.json ./ + +# Expose port +EXPOSE 5021 + +# Set environment variables +ENV NODE_ENV=production +ENV PORT=5021 +ENV HOST=0.0.0.0 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:5021/health || exit 1 + +# Run the app +CMD ["node", "build"] diff --git a/apps/planta/apps/backend/Dockerfile b/apps/planta/apps/backend/Dockerfile index 2166b9f1a..1a0b70230 100644 --- a/apps/planta/apps/backend/Dockerfile +++ b/apps/planta/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -28,7 +29,7 @@ COPY apps/planta/packages ./apps/planta/packages COPY apps/planta/apps/backend ./apps/planta/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/presi/apps/backend/Dockerfile b/apps/presi/apps/backend/Dockerfile index 8cced3821..b85c0318a 100644 --- a/apps/presi/apps/backend/Dockerfile +++ b/apps/presi/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -27,7 +28,7 @@ COPY apps/presi/packages ./apps/presi/packages COPY apps/presi/apps/backend ./apps/presi/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/presi/apps/web/Dockerfile b/apps/presi/apps/web/Dockerfile index 2a9ab1f2e..a2783d3b7 100644 --- a/apps/presi/apps/web/Dockerfile +++ b/apps/presi/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -45,7 +46,7 @@ COPY packages/shared-utils ./packages/shared-utils COPY apps/presi/apps/web ./apps/presi/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-auth diff --git a/apps/skilltree/apps/backend/Dockerfile b/apps/skilltree/apps/backend/Dockerfile index 0445d6ff3..655fce5e0 100644 --- a/apps/skilltree/apps/backend/Dockerfile +++ b/apps/skilltree/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -26,7 +27,7 @@ COPY packages/shared-tsconfig ./packages/shared-tsconfig COPY apps/skilltree/apps/backend ./apps/skilltree/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/skilltree/apps/web/Dockerfile b/apps/skilltree/apps/web/Dockerfile index a4cd617ec..6719687e4 100644 --- a/apps/skilltree/apps/web/Dockerfile +++ b/apps/skilltree/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -36,7 +37,7 @@ COPY packages/shared-api-client ./packages/shared-api-client COPY apps/skilltree/apps/web ./apps/skilltree/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/storage/apps/backend/Dockerfile b/apps/storage/apps/backend/Dockerfile index c4a4c343e..97e0ab653 100644 --- a/apps/storage/apps/backend/Dockerfile +++ b/apps/storage/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -26,7 +27,7 @@ COPY packages/shared-nestjs-setup ./packages/shared-nestjs-setup COPY apps/storage/apps/backend ./apps/storage/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/storage/apps/web/Dockerfile b/apps/storage/apps/web/Dockerfile index c9cde0833..276e086ee 100644 --- a/apps/storage/apps/web/Dockerfile +++ b/apps/storage/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -48,7 +49,7 @@ COPY packages/shared-vite-config ./packages/shared-vite-config COPY apps/storage/apps/web ./apps/storage/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/todo/apps/backend/Dockerfile b/apps/todo/apps/backend/Dockerfile index 6e2784109..62a9f2686 100644 --- a/apps/todo/apps/backend/Dockerfile +++ b/apps/todo/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -28,7 +29,7 @@ COPY apps/todo/packages ./apps/todo/packages COPY apps/todo/apps/backend ./apps/todo/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/todo/apps/web/Dockerfile b/apps/todo/apps/web/Dockerfile index d9842de22..096409abb 100644 --- a/apps/todo/apps/web/Dockerfile +++ b/apps/todo/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -50,7 +51,7 @@ COPY apps/todo/packages ./apps/todo/packages COPY apps/todo/apps/web ./apps/todo/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/apps/zitare/apps/backend/Dockerfile b/apps/zitare/apps/backend/Dockerfile index 323e31e13..f91baf92e 100644 --- a/apps/zitare/apps/backend/Dockerfile +++ b/apps/zitare/apps/backend/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -29,7 +30,7 @@ COPY apps/zitare/packages/content ./apps/zitare/packages/content COPY apps/zitare/apps/backend ./apps/zitare/apps/backend # Install dependencies (ignore scripts since generate-env.mjs isn't in Docker context) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) WORKDIR /app/packages/shared-errors diff --git a/apps/zitare/apps/web/Dockerfile b/apps/zitare/apps/web/Dockerfile index 1874c0982..e1b5000d2 100644 --- a/apps/zitare/apps/web/Dockerfile +++ b/apps/zitare/apps/web/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -49,7 +50,7 @@ COPY apps/zitare/packages/content ./apps/zitare/packages/content COPY apps/zitare/apps/web ./apps/zitare/apps/web # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-vite-config diff --git a/cloudflared-config.yml b/cloudflared-config.yml index c40695963..94cc97d3c 100644 --- a/cloudflared-config.yml +++ b/cloudflared-config.yml @@ -76,6 +76,12 @@ ingress: - hostname: mukke-api.mana.how service: http://localhost:3010 + # Picture App + - hostname: picture.mana.how + service: http://localhost:5021 + - hostname: picture-api.mana.how + service: http://localhost:3040 + # LLM Services - hostname: playground.mana.how service: http://localhost:5090 @@ -86,6 +92,10 @@ ingress: - hostname: tts-api.mana.how service: http://localhost:3022 + # Games + - hostname: whopxl.mana.how + service: http://localhost:5100 + # Monitoring & Tools - hostname: grafana.mana.how service: http://localhost:8000 diff --git a/docker-compose.macmini.yml b/docker-compose.macmini.yml index 3416bd4af..598ab31c1 100644 --- a/docker-compose.macmini.yml +++ b/docker-compose.macmini.yml @@ -5,6 +5,7 @@ # 3000-3099: Core Services & Backends # 4000-4099: Matrix Stack # 5000-5099: Web Frontends +# 5100-5199: Games # 6000-6099: Automation & Workflows # 8000-8099: Monitoring Dashboards # 9000-9199: Infrastructure & Exporters @@ -147,7 +148,7 @@ services: TODO_BACKEND_URL: http://todo-backend:3031 CALENDAR_BACKEND_URL: http://calendar-backend:3032 CONTACTS_BACKEND_URL: http://contacts-backend:3034 - PICTURE_BACKEND_URL: http://photos-backend:3039 + PICTURE_BACKEND_URL: http://picture-backend:3040 PRESI_BACKEND_URL: http://presi-backend:3036 ZITARE_BACKEND_URL: http://zitare-backend:3007 PHOTOS_BACKEND_URL: http://photos-backend:3039 @@ -1603,6 +1604,74 @@ services: retries: 3 start_period: 40s + picture-backend: + build: + context: . + dockerfile: apps/picture/apps/backend/Dockerfile + image: picture-backend:local + container_name: mana-app-picture-backend + restart: always + depends_on: + mana-auth: + condition: service_healthy + minio: + condition: service_healthy + environment: + NODE_ENV: production + PORT: 3040 + DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-mana123}@postgres:5432/picture + DB_HOST: postgres + DB_PORT: 5432 + DB_USER: postgres + MANA_CORE_AUTH_URL: http://mana-auth:3001 + REPLICATE_API_TOKEN: ${REPLICATE_API_TOKEN} + APP_ID: picture-app + MANA_CORE_SERVICE_KEY: ${MANA_CORE_SERVICE_KEY} + S3_ENDPOINT: http://minio:9000 + S3_PUBLIC_ENDPOINT: https://minio.mana.how + S3_REGION: us-east-1 + S3_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin} + S3_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin} + S3_BUCKET: picture-storage + CORS_ORIGINS: https://picture.mana.how,https://mana.how + ports: + - "3040:3040" + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3040/api/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + + picture-web: + build: + context: . + dockerfile: apps/picture/apps/web/Dockerfile + args: + PUBLIC_BACKEND_URL: http://picture-backend:3040 + PUBLIC_MANA_CORE_AUTH_URL: http://mana-auth:3001 + image: picture-web:local + container_name: mana-app-picture-web + restart: always + depends_on: + picture-backend: + condition: service_healthy + environment: + NODE_ENV: production + PORT: 5021 + PUBLIC_BACKEND_URL: http://picture-backend:3040 + PUBLIC_MANA_CORE_AUTH_URL: http://mana-auth:3001 + PUBLIC_BACKEND_URL_CLIENT: https://picture-api.mana.how + PUBLIC_MANA_CORE_AUTH_URL_CLIENT: https://auth.mana.how + ports: + - "5021:5021" + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:5021/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + mana-llm: build: context: ./services/mana-llm @@ -2008,6 +2077,30 @@ services: redis: condition: service_healthy + # ============================================ + # Games + # ============================================ + + whopixels: + build: + context: . + dockerfile: games/whopixels/Dockerfile + container_name: mana-game-whopixels + restart: unless-stopped + environment: + PORT: 5100 + AZURE_OPENAI_API_KEY: ${AZURE_OPENAI_API_KEY:-} + AZURE_OPENAI_ENDPOINT: ${AZURE_OPENAI_ENDPOINT:-} + AZURE_OPENAI_DEPLOYMENT: ${AZURE_OPENAI_DEPLOYMENT:-} + AZURE_OPENAI_API_VERSION: ${AZURE_OPENAI_API_VERSION:-} + ports: + - "5100:5100" + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://localhost:5100/"] + interval: 30s + timeout: 10s + retries: 3 + volumes: redis_data: name: mana-redis-data diff --git a/docker/caddy/Caddyfile.production b/docker/caddy/Caddyfile.production index d475a65d0..f08ddfb98 100644 --- a/docker/caddy/Caddyfile.production +++ b/docker/caddy/Caddyfile.production @@ -111,6 +111,13 @@ playground.mana.how { reverse_proxy localhost:5090 } +# ============================================ +# Games +# ============================================ +whopxl.mana.how { + reverse_proxy localhost:5100 +} + # ============================================ # Monitoring & Analytics # ============================================ diff --git a/docker/templates/Dockerfile.astro b/docker/templates/Dockerfile.astro index f41c93e40..3f25af233 100644 --- a/docker/templates/Dockerfile.astro +++ b/docker/templates/Dockerfile.astro @@ -1,11 +1,10 @@ -# Multi-stage Dockerfile for Astro landing pages # This is a template - copy and customize for each -landing page # ============================================ # Build Stage # -============================================ FROM node:20-alpine AS builder # Install pnpm RUN -corepack enable && corepack prepare pnpm@9.15.0 --activate WORKDIR /app # Copy workspace files COPY -pnpm-workspace.yaml ./ COPY package.json ./ COPY pnpm-lock.yaml ./ # Copy all shared packages COPY -packages/ ./packages/ # Copy the specific landing page ARG SERVICE_PATH COPY ${SERVICE_PATH} ./${ - SERVICE_PATH -} +# syntax=docker/dockerfile:1 # Multi-stage Dockerfile for Astro landing pages # This is a template - +copy and customize for each landing page # ============================================ # Build +Stage # ============================================ FROM node:20-alpine AS builder # Install pnpm +RUN corepack enable && corepack prepare pnpm@9.15.0 --activate WORKDIR /app # Copy workspace files +COPY pnpm-workspace.yaml ./ COPY package.json ./ COPY pnpm-lock.yaml ./ # Copy all shared packages +COPY packages/ ./packages/ # Copy the specific landing page ARG SERVICE_PATH COPY ${SERVICE_PATH} +./${SERVICE_PATH} # Install all dependencies RUN pnpm install --frozen-lockfile # Build shared packages first RUN pnpm run build:packages # Build the landing page WORKDIR /app/${SERVICE_PATH} RUN pnpm build # ============================================ # Production Stage - Nginx # ============================================ diff --git a/docker/templates/Dockerfile.nestjs b/docker/templates/Dockerfile.nestjs index c8f24155a..79bc90dcb 100644 --- a/docker/templates/Dockerfile.nestjs +++ b/docker/templates/Dockerfile.nestjs @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Multi-stage Dockerfile for NestJS backend services # This is a template - copy and customize for each backend service @@ -26,7 +27,7 @@ ARG SERVICE_PATH COPY ${SERVICE_PATH} ./${SERVICE_PATH} # Install all dependencies (including devDependencies for build) -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages first RUN pnpm run build:packages @@ -60,7 +61,7 @@ ARG SERVICE_PATH COPY --from=builder /app/${SERVICE_PATH} ./${SERVICE_PATH} # Install production dependencies only -RUN pnpm install --prod --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --prod --frozen-lockfile # Create non-root user RUN addgroup -g 1001 -S nodejs && \ diff --git a/docker/templates/Dockerfile.sveltekit b/docker/templates/Dockerfile.sveltekit index 4375119ea..6e82d70d4 100644 --- a/docker/templates/Dockerfile.sveltekit +++ b/docker/templates/Dockerfile.sveltekit @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Multi-stage Dockerfile for SvelteKit web applications # This is a template - copy and customize for each web app @@ -24,7 +25,7 @@ ARG SERVICE_PATH COPY ${SERVICE_PATH} ./${SERVICE_PATH} # Install all dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages first RUN pnpm run build:packages @@ -58,7 +59,7 @@ COPY --from=builder /app/${SERVICE_PATH}/build ./${SERVICE_PATH}/build COPY --from=builder /app/${SERVICE_PATH}/package.json ./${SERVICE_PATH}/package.json # Install production dependencies -RUN pnpm install --prod --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --prod --frozen-lockfile # Create non-root user RUN addgroup -g 1001 -S nodejs && \ diff --git a/games/whopixels/Dockerfile b/games/whopixels/Dockerfile new file mode 100644 index 000000000..800b967d6 --- /dev/null +++ b/games/whopixels/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY games/whopixels/package.json ./ +RUN npm install --production + +COPY games/whopixels/ ./ + +ENV PORT=5100 +EXPOSE 5100 + +CMD ["node", "server.js"] diff --git a/games/whopixels/server.js b/games/whopixels/server.js index 6d5f9fe7f..5b9c67475 100644 --- a/games/whopixels/server.js +++ b/games/whopixels/server.js @@ -10,7 +10,7 @@ require('dotenv').config(); const { parse } = require('querystring'); // Konfiguration -const PORT = 3000; +const PORT = process.env.PORT || 3000; // Azure OpenAI API Konfiguration aus Umgebungsvariablen const AZURE_OPENAI_API_KEY = process.env.AZURE_OPENAI_API_KEY; diff --git a/services/llm-playground/Dockerfile b/services/llm-playground/Dockerfile index c17ba3b35..b8f9b8c24 100644 --- a/services/llm-playground/Dockerfile +++ b/services/llm-playground/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -30,7 +31,7 @@ COPY packages/shared-icons ./packages/shared-icons COPY services/llm-playground ./services/llm-playground # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build shared packages that need building WORKDIR /app/packages/shared-auth diff --git a/services/mana-api-gateway/Dockerfile b/services/mana-api-gateway/Dockerfile index 07d364695..3344b4c38 100644 --- a/services/mana-api-gateway/Dockerfile +++ b/services/mana-api-gateway/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # ================================ # Build Stage (Monorepo-aware) # ================================ @@ -10,7 +11,7 @@ FROM base AS deps COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ COPY services/mana-api-gateway/package.json ./services/mana-api-gateway/ COPY packages/shared-nestjs-auth/package.json ./packages/shared-nestjs-auth/ -RUN pnpm install --frozen-lockfile --filter @manacore/api-gateway... +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --filter @manacore/api-gateway... # Build the application FROM base AS builder diff --git a/services/mana-core-auth/Dockerfile b/services/mana-core-auth/Dockerfile index 09c077ba8..577d92eea 100644 --- a/services/mana-core-auth/Dockerfile +++ b/services/mana-core-auth/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage # Using node:20-slim instead of alpine for DuckDB glibc compatibility FROM node:20-slim AS builder @@ -20,7 +21,7 @@ COPY packages/shared-storage ./packages/shared-storage COPY services/mana-core-auth ./services/mana-core-auth # Install all dependencies (without ignore-scripts to build native modules like bcrypt) -RUN pnpm install --no-frozen-lockfile --filter mana-core-auth... --filter @manacore/shared-storage +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --no-frozen-lockfile --filter mana-core-auth... --filter @manacore/shared-storage # Build shared-storage first WORKDIR /app/packages/shared-storage diff --git a/services/mana-crawler/Dockerfile b/services/mana-crawler/Dockerfile index b275dcdeb..a8c6413a5 100644 --- a/services/mana-crawler/Dockerfile +++ b/services/mana-crawler/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-alpine AS builder @@ -17,7 +18,7 @@ COPY services/mana-crawler/package.json ./services/mana-crawler/ COPY packages/shared-drizzle-config/package.json ./packages/shared-drizzle-config/ # Install dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Copy source code COPY services/mana-crawler ./services/mana-crawler @@ -42,7 +43,7 @@ COPY --from=builder /app/services/mana-crawler/package.json ./services/mana-craw COPY --from=builder /app/packages/shared-drizzle-config/package.json ./packages/shared-drizzle-config/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod # Copy built files COPY --from=builder /app/services/mana-crawler/dist ./services/mana-crawler/dist diff --git a/services/mana-media/apps/api/Dockerfile b/services/mana-media/apps/api/Dockerfile index 1b727a2c4..0faf4d785 100644 --- a/services/mana-media/apps/api/Dockerfile +++ b/services/mana-media/apps/api/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # ================================ # Build Stage # ================================ @@ -11,7 +12,7 @@ COPY packages/shared-drizzle-config ./packages/shared-drizzle-config COPY services/mana-media ./services/mana-media # Install all dependencies -RUN pnpm install --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile # Build the API WORKDIR /app/services/mana-media/apps/api diff --git a/services/mana-notify/Dockerfile b/services/mana-notify/Dockerfile index a3e224e5b..8328d9b47 100644 --- a/services/mana-notify/Dockerfile +++ b/services/mana-notify/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 FROM node:20-alpine AS base # Install pnpm @@ -13,7 +14,7 @@ COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./ COPY services/mana-notify/package.json ./services/mana-notify/ # Install dependencies -RUN pnpm install --frozen-lockfile --filter @manacore/mana-notify +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --filter @manacore/mana-notify # Copy source code COPY services/mana-notify ./services/mana-notify diff --git a/services/mana-search/Dockerfile b/services/mana-search/Dockerfile index ce75f5564..6d653a061 100644 --- a/services/mana-search/Dockerfile +++ b/services/mana-search/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # ================================ # Build Stage (Monorepo-aware) # ================================ @@ -9,7 +10,7 @@ WORKDIR /app FROM base AS deps COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ COPY services/mana-search/package.json ./services/mana-search/ -RUN pnpm install --frozen-lockfile --filter @manacore/mana-search... +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --filter @manacore/mana-search... # Build the application FROM base AS builder diff --git a/services/matrix-calendar-bot/Dockerfile b/services/matrix-calendar-bot/Dockerfile index 87e0de403..26eb5c250 100644 --- a/services/matrix-calendar-bot/Dockerfile +++ b/services/matrix-calendar-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-calendar-bot ./services/matrix-calendar-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-calendar-bot/dist ./services/matrix-cal COPY --from=builder /app/services/matrix-calendar-bot/package.json ./services/matrix-calendar-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-clock-bot/Dockerfile b/services/matrix-clock-bot/Dockerfile index 1fd45e0c2..d462e0551 100644 --- a/services/matrix-clock-bot/Dockerfile +++ b/services/matrix-clock-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-clock-bot ./services/matrix-clock-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-clock-bot/dist ./services/matrix-clock- COPY --from=builder /app/services/matrix-clock-bot/package.json ./services/matrix-clock-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-mana-bot/Dockerfile b/services/matrix-mana-bot/Dockerfile index d23384bad..c48b3a391 100644 --- a/services/matrix-mana-bot/Dockerfile +++ b/services/matrix-mana-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-mana-bot ./services/matrix-mana-bot # Install all dependencies (--ignore-scripts to skip root postinstall hooks) -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-mana-bot/dist ./services/matrix-mana-bo COPY --from=builder /app/services/matrix-mana-bot/package.json ./services/matrix-mana-bot/ # Install production dependencies only (--ignore-scripts to skip root postinstall hooks) -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-nutriphi-bot/Dockerfile b/services/matrix-nutriphi-bot/Dockerfile index bb0501557..3af3fccd8 100644 --- a/services/matrix-nutriphi-bot/Dockerfile +++ b/services/matrix-nutriphi-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-nutriphi-bot ./services/matrix-nutriphi-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-nutriphi-bot/dist ./services/matrix-nut COPY --from=builder /app/services/matrix-nutriphi-bot/package.json ./services/matrix-nutriphi-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-ollama-bot/Dockerfile b/services/matrix-ollama-bot/Dockerfile index e2ee39528..47f2e54c1 100644 --- a/services/matrix-ollama-bot/Dockerfile +++ b/services/matrix-ollama-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-ollama-bot ./services/matrix-ollama-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-ollama-bot/dist ./services/matrix-ollam COPY --from=builder /app/services/matrix-ollama-bot/package.json ./services/matrix-ollama-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-onboarding-bot/Dockerfile b/services/matrix-onboarding-bot/Dockerfile index bc35c55b3..10a3b4494 100644 --- a/services/matrix-onboarding-bot/Dockerfile +++ b/services/matrix-onboarding-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-onboarding-bot ./services/matrix-onboarding-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-onboarding-bot/dist ./services/matrix-o COPY --from=builder /app/services/matrix-onboarding-bot/package.json ./services/matrix-onboarding-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-planta-bot/Dockerfile b/services/matrix-planta-bot/Dockerfile index ab5c16721..f164e39ba 100644 --- a/services/matrix-planta-bot/Dockerfile +++ b/services/matrix-planta-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-planta-bot ./services/matrix-planta-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-planta-bot/dist ./services/matrix-plant COPY --from=builder /app/services/matrix-planta-bot/package.json ./services/matrix-planta-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-project-doc-bot/Dockerfile b/services/matrix-project-doc-bot/Dockerfile index 0c6c1985b..5f9a4156f 100644 --- a/services/matrix-project-doc-bot/Dockerfile +++ b/services/matrix-project-doc-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-project-doc-bot ./services/matrix-project-doc-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-project-doc-bot/dist ./services/matrix- COPY --from=builder /app/services/matrix-project-doc-bot/package.json ./services/matrix-project-doc-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-stats-bot/Dockerfile b/services/matrix-stats-bot/Dockerfile index 08a0a535c..0f44b313c 100644 --- a/services/matrix-stats-bot/Dockerfile +++ b/services/matrix-stats-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-stats-bot ./services/matrix-stats-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-stats-bot/dist ./services/matrix-stats- COPY --from=builder /app/services/matrix-stats-bot/package.json ./services/matrix-stats-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-stt-bot/Dockerfile b/services/matrix-stt-bot/Dockerfile index 299a595dc..1e239a110 100644 --- a/services/matrix-stt-bot/Dockerfile +++ b/services/matrix-stt-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-stt-bot ./services/matrix-stt-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-stt-bot/dist ./services/matrix-stt-bot/ COPY --from=builder /app/services/matrix-stt-bot/package.json ./services/matrix-stt-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-todo-bot/Dockerfile b/services/matrix-todo-bot/Dockerfile index 88364e441..a83436b4d 100644 --- a/services/matrix-todo-bot/Dockerfile +++ b/services/matrix-todo-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-todo-bot ./services/matrix-todo-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-todo-bot/dist ./services/matrix-todo-bo COPY --from=builder /app/services/matrix-todo-bot/package.json ./services/matrix-todo-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-tts-bot/Dockerfile b/services/matrix-tts-bot/Dockerfile index a51944e29..75f8b77fa 100644 --- a/services/matrix-tts-bot/Dockerfile +++ b/services/matrix-tts-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-tts-bot ./services/matrix-tts-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-tts-bot/dist ./services/matrix-tts-bot/ COPY --from=builder /app/services/matrix-tts-bot/package.json ./services/matrix-tts-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-zitare-bot/Dockerfile b/services/matrix-zitare-bot/Dockerfile index b5ac2575e..e6c317165 100644 --- a/services/matrix-zitare-bot/Dockerfile +++ b/services/matrix-zitare-bot/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # Build stage FROM node:20-slim AS builder @@ -17,7 +18,7 @@ COPY packages/matrix-bot-common ./packages/matrix-bot-common COPY services/matrix-zitare-bot ./services/matrix-zitare-bot # Install all dependencies -RUN pnpm install --frozen-lockfile --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build @@ -49,7 +50,7 @@ COPY --from=builder /app/services/matrix-zitare-bot/dist ./services/matrix-zitar COPY --from=builder /app/services/matrix-zitare-bot/package.json ./services/matrix-zitare-bot/ # Install production dependencies only -RUN pnpm install --frozen-lockfile --prod --ignore-scripts +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts # Create data directory RUN mkdir -p /app/data