File tree Expand file tree Collapse file tree 6 files changed +158
-52
lines changed
Expand file tree Collapse file tree 6 files changed +158
-52
lines changed Original file line number Diff line number Diff line change 1- FROM node:18-slim
1+ FROM node:18-slim AS base
2+ WORKDIR /app
3+ RUN npm install -g pnpm turbo
24
5+ # BUILDER
6+ FROM base AS builder
37WORKDIR /app
8+ COPY . .
9+ RUN turbo prune --scope=auth-service --docker
410
5- RUN npm install -g pnpm
11+ # INSTALLER
12+ FROM base AS installer
13+ WORKDIR /app
614
7- ENV HUSKY=0
8- ENV CI=true
9-
10- COPY . .
15+ COPY --from=builder /app/out/json/ .
16+ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
17+
18+ RUN pnpm install --frozen-lockfile
1119
20+ COPY --from=builder /app/out/full/ .
1221
13- RUN pnpm install
22+ RUN pnpm turbo run build --filter=auth-service
1423
15- RUN pnpm --filter ./apps/auth-service... exec tsc
24+ # RUNNER
25+ FROM node:18-slim AS runner
26+ WORKDIR /app
27+
28+ RUN apt-get update && apt-get install -y curl
29+
30+ ENV NODE_ENV=production
31+
32+ COPY --from=installer /app .
1633
1734EXPOSE 4001
1835
19- CMD ["pnpm" ,"--filter" ,"./apps/auth-service..." ,"start" ]
36+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
37+ CMD curl -f http://localhost:4001/api/health || exit 1
38+
39+ CMD ["node" ,"apps/auth-service/dist/index.js" ]
Original file line number Diff line number Diff line change 1- FROM node:18-slim
1+ FROM node:18-slim AS base
2+ WORKDIR /app
3+ RUN npm install -g pnpm turbo
24
5+ # BUILDER
6+ FROM base AS builder
37WORKDIR /app
8+ COPY . .
9+ RUN turbo prune --scope=clinical-service --docker
410
5- RUN npm install -g pnpm
11+ # INSTALLER
12+ FROM base AS installer
13+ WORKDIR /app
614
7- ENV HUSKY=0
8- ENV CI=true
9-
10- COPY . .
15+ COPY --from=builder /app/out/json/ .
16+ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
17+
18+ RUN pnpm install --frozen-lockfile
19+
20+ COPY --from=builder /app/out/full/ .
21+
22+ RUN pnpm turbo run build --filter=clinical-service
23+
24+ # RUNNER
25+ FROM node:18-slim AS runner
26+ WORKDIR /app
27+
28+ RUN apt-get update && apt-get install -y curl
1129
30+ ENV NODE_ENV=production
1231
13- RUN pnpm install
32+ COPY --from=installer /app .
1433
15- RUN pnpm --filter ./apps/clinical-service... exec tsc
34+ EXPOSE 4004
1635
17- EXPOSE 4003
36+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
37+ CMD curl -f http://localhost:4004/api/clinical/health-clinical || exit 1
1838
19- CMD ["pnpm " ,"--filter" , "./ apps/clinical-service..." , "start " ]
39+ CMD ["node " ,"apps/clinical-service/dist/index.js " ]
Original file line number Diff line number Diff line change 1- FROM node:18-slim
1+ FROM node:18-slim AS base
2+ WORKDIR /app
3+ RUN npm install -g pnpm turbo
24
5+ # BUILDER
6+ FROM base AS builder
37WORKDIR /app
8+ COPY . .
9+ RUN turbo prune --scope=patient-service --docker
410
5- RUN npm install -g pnpm
11+ # INSTALLER
12+ FROM base AS installer
13+ WORKDIR /app
614
7- ENV HUSKY=0
8- ENV CI=true
9-
10- COPY . .
15+ COPY --from=builder /app/out/json/ .
16+ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
17+
18+ RUN pnpm install --frozen-lockfile
1119
20+ COPY --from=builder /app/out/full/ .
1221
13- RUN pnpm install
22+ RUN pnpm turbo run build --filter=patient-service
1423
15- RUN pnpm --filter ./apps/patient-service... exec tsc
24+ # RUNNER
25+ FROM node:18-slim AS runner
26+ WORKDIR /app
27+
28+ RUN apt-get update && apt-get install -y curl
29+
30+ ENV NODE_ENV=production
31+
32+ COPY --from=installer /app .
1633
1734EXPOSE 4002
1835
19- CMD ["pnpm" ,"--filter" ,"./apps/patient-service..." ,"start" ]
36+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
37+ CMD curl -f http://localhost:4002/api/patient/health-patient || exit 1
38+
39+ CMD ["node" ,"apps/patient-service/dist/index.js" ]
Original file line number Diff line number Diff line change 1- FROM node:18-slim
1+ FROM node:18-slim AS base
2+ WORKDIR /app
3+ RUN npm install -g pnpm turbo
24
5+ # BUILDER
6+ FROM base AS builder
37WORKDIR /app
8+ COPY . .
9+ RUN turbo prune --scope=report-analytics-service --docker
410
5- RUN npm install -g pnpm
11+ # INSTALLER
12+ FROM base AS installer
13+ WORKDIR /app
614
7- ENV HUSKY=0
8- ENV CI=true
9-
10- COPY . .
15+ COPY --from=builder /app/out/json/ .
16+ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
17+
18+ RUN pnpm install --frozen-lockfile
19+
20+ COPY --from=builder /app/out/full/ .
21+
22+ RUN pnpm turbo run build --filter=report-analytics-service
23+
24+ # RUNNER
25+ FROM node:18-slim AS runner
26+ WORKDIR /app
27+
28+ RUN apt-get update && apt-get install -y curl
1129
30+ ENV NODE_ENV=production
1231
13- RUN pnpm install
32+ COPY --from=installer /app .
1433
15- RUN pnpm --filter ./apps/report-analytics-service... exec tsc
34+ EXPOSE 4002
1635
17- EXPOSE 4006
36+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
37+ CMD curl -f http://localhost:4006/api/reports-analytics/health-report || exit 1
1838
19- CMD ["pnpm " ,"--filter" , "./ apps/report-analytics-service..." , "start " ]
39+ CMD ["node " ,"apps/report-analytics-service/dist/index.js " ]
Original file line number Diff line number Diff line change 1-
1+ # BUILD STAGE
22FROM node:18-slim AS builder
33
44WORKDIR /app
5+
56RUN npm install -g pnpm
6- ENV CI=true
77
88COPY . .
9+
910RUN pnpm install
11+
1012RUN pnpm --filter web-app build
1113
14+ # NGINX STAGE
1215FROM nginx:alpine
1316
14- COPY --from=builder /app/apps/web-app/dist /usr/share/nginx/html
17+ RUN apk add --no-cache curl
18+
19+ COPY apps/web-app/dist /usr/share/nginx/html
1520COPY infra/nginx/default.conf /etc/nginx/conf.d/default.conf
16-
21+
1722EXPOSE 80
1823
19- CMD ["nginx" ,"-g" , "daemon off;" ]
24+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
25+ CMD curl -f http://localhost/ || exit 1
Original file line number Diff line number Diff line change 1- FROM node:18-slim
1+ FROM node:18-slim AS base
2+ WORKDIR /app
3+ RUN npm install -g pnpm turbo
24
5+ # BUILDER
6+ FROM base AS builder
37WORKDIR /app
8+ COPY . .
9+ RUN turbo prune --scope=worker-service --docker
410
5- RUN npm install -g pnpm
11+ # INSTALLER
12+ FROM base AS installer
13+ WORKDIR /app
614
7- ENV HUSKY=0
8- ENV CI=true
9-
10- COPY . .
15+ COPY --from=builder /app/out/json/ .
16+ COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
17+
18+ RUN pnpm install --frozen-lockfile
1119
20+ COPY --from=builder /app/out/full/ .
1221
13- RUN pnpm install
22+ RUN pnpm turbo run build --filter=worker-service
1423
15- RUN pnpm --filter ./apps/worker-service... exec tsc
24+ # RUNNER
25+ FROM node:18-slim AS runner
26+ WORKDIR /app
27+
28+ RUN apt-get update && apt-get install -y curl
29+
30+ ENV NODE_ENV=production
31+
32+ COPY --from=installer /app .
1633
1734EXPOSE 4005
1835
19- CMD ["pnpm" ,"--filter" ,"./apps/worker-service..." ,"start" ]
36+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
37+ CMD curl -f http://localhost:4005/api/worker/health-worker || exit 1
38+
39+ CMD ["node" ,"apps/worker-service/dist/worker.js" ]
You can’t perform that action at this time.
0 commit comments