This commit is contained in:
Morten Olsen
2025-09-09 18:06:45 +02:00
parent ba7aa90434
commit 0ff0b0992b
25 changed files with 3177 additions and 198 deletions

32
Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
FROM node:23-alpine AS base
ENV NODE_ENV=production
FROM base AS builder
RUN apk update
RUN apk add --no-cache libc6-compat
WORKDIR /app
RUN corepack enable
RUN npm install -g turbo
COPY . .
RUN turbo prune @morten-olsen/fluxcurrent-server --docker
FROM base AS installer
RUN apk update
RUN apk add --no-cache libc6-compat
RUN corepack enable
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN pnpm install --prod --frozen-lockfile
COPY --from=builder /app/out/full/ .
FROM base AS runner
WORKDIR /app
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 fluxcurrent
COPY --from=installer /app/ ./
USER fluxcurrent
CMD ["node", "--no-warnings", "packages/server/src/start.ts"]