-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (35 loc) · 1.28 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (35 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Multi-stage Docker build (deployed via Coolify)
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package manifests
COPY package*.json ./
COPY apps/marketing/package*.json ./apps/marketing/
COPY apps/web/package*.json ./apps/web/
COPY apps/server/package*.json ./apps/server/
COPY packages/shared/package*.json ./packages/shared/
# Install dependencies
RUN npm ci
# Copy full source
COPY . .
# Build all applications and packages
ENV ASTRO_TELEMETRY_DISABLED=1
RUN npm run build
# Production runner
FROM node:20-alpine AS runner
# wget for the HEALTHCHECK below - not in the base alpine image. Railway never
# surfaced this because it health-checked over HTTP from outside the
# container; Coolify runs this Dockerfile's HEALTHCHECK command inside it.
RUN apk add --no-cache wget
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=8080
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/server ./apps/server
COPY --from=builder /app/apps/web/dist ./apps/web/dist
COPY --from=builder /app/packages/shared ./packages/shared
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1
CMD ["npm", "start"]