Build & Deploy / build-and-push (backend) (push) Failing after 35s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 25s
Build & Deploy / build-and-push (proxy) (push) Failing after 25s
- Remove pnpm workspace, moon repo, and all monorepo tooling - Delete packages/shared/, embed shared code directly into each service - Copy packages/shared/src/* -> services/backend/src/shared/ and services/discord-gateway/src/shared/ - Replace all @bete/shared imports with @/shared/ path alias - Remove @bete/shared workspace dependency from both services - Update root package.json scripts from --filter to --prefix - Rewrite Dockerfiles to build each service standalone - Clean up biome.json, .gitignore, remove root drizzle.config.ts
49 lines
1.5 KiB
Docker
49 lines
1.5 KiB
Docker
# ---- Stage 1: Build Next.js static export ----
|
|
FROM node:22-slim AS frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN corepack enable
|
|
|
|
# Install build essentials for native deps
|
|
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
|
|
python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy dependency manifests first for layer caching
|
|
COPY services/frontend/package.json services/frontend/pnpm-lock.yaml* ./services/frontend/
|
|
COPY services/frontend/tsconfig.json ./services/frontend/tsconfig.json
|
|
|
|
# Install frontend dependencies (standalone, no shared workspace dep)
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
|
cd services/frontend && pnpm install --no-frozen-lockfile
|
|
|
|
# Copy source code
|
|
COPY services/frontend/ ./services/frontend/
|
|
|
|
# Pass API/WS URLs as build args
|
|
ARG VITE_BE_API_URL
|
|
ARG VITE_BE_WS_URL
|
|
ENV VITE_BE_API_URL=${VITE_BE_API_URL}
|
|
ENV VITE_BE_WS_URL=${VITE_BE_WS_URL}
|
|
|
|
# Build frontend static export
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
|
cd services/frontend && pnpm run build
|
|
|
|
# ---- Stage 2: Nginx ----
|
|
FROM nginx:alpine
|
|
|
|
# Nginx config (API/WS proxy + static file serving)
|
|
COPY infra/docker/nginx/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Static export from frontend builder
|
|
COPY --from=frontend-builder /app/services/frontend/out/ /usr/share/nginx/html/
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://localhost:80/ || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|