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
57 lines
2.0 KiB
Docker
57 lines
2.0 KiB
Docker
# ---- Stage 1: Build native deps + TypeScript ----
|
|
FROM node:22-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN corepack enable
|
|
|
|
# Build tools + Rust for native compilation
|
|
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
|
|
python3 make g++ curl ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Dependency manifests
|
|
COPY services/discord-gateway/package.json services/discord-gateway/pnpm-lock.yaml* ./services/discord-gateway/
|
|
COPY patches ./patches
|
|
|
|
# Install ALL deps (including devDeps needed for build)
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
|
cd services/discord-gateway && pnpm install --frozen-lockfile
|
|
|
|
# Source code (shared code is embedded in src/shared/)
|
|
COPY services/discord-gateway ./services/discord-gateway
|
|
COPY services/discord-gateway/drizzle ./drizzle
|
|
|
|
# Build
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
|
cd services/discord-gateway && pnpm run build \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# ---- Stage 2: Runtime (minimal) ----
|
|
FROM node:22-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Runtime system deps only
|
|
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
|
|
ffmpeg ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy built artifacts
|
|
COPY --from=builder /app/services/discord-gateway/dist ./services/discord-gateway/dist
|
|
COPY --from=builder /app/services/discord-gateway/node_modules ./services/discord-gateway/node_modules
|
|
COPY --from=builder /app/services/discord-gateway/package.json ./services/discord-gateway/package.json
|
|
COPY --from=builder /app/drizzle ./drizzle
|
|
|
|
# Create recordings dir and set ownership
|
|
RUN mkdir -p /app/recordings && chown -R node:node /app
|
|
USER node
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
|
CMD sh -c "kill -0 1"
|
|
|
|
CMD ["node", "services/discord-gateway/dist/index.js"]
|