-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
47 lines (32 loc) · 1.27 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
FROM node:22-slim AS build
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json package-lock.json ./
COPY API/package.json API/
COPY Auth/package.json Auth/
RUN npm ci --include-workspace-root
COPY API/ API/
COPY Auth/ Auth/
COPY tsconfig.base.json ./
RUN npm run prisma:generate --workspace API
RUN npm run build --workspace API
RUN npm run build --workspace Auth
FROM node:22-slim AS runtime
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json package-lock.json ./
COPY API/package.json API/
COPY Auth/package.json Auth/
RUN npm ci --workspace API --workspace Auth --include-workspace-root --omit=dev
COPY --from=build /app/API/dist/ API/dist/
COPY --from=build /app/API/prisma/ API/prisma/
COPY --from=build /app/Auth/dist/ Auth/dist/
COPY --from=build /app/Auth/dist-ssr/ Auth/dist-ssr/
COPY --from=build /app/node_modules/.prisma/ node_modules/.prisma/
COPY --from=build /app/node_modules/@prisma/ node_modules/@prisma/
COPY --from=build /app/node_modules/prisma/ node_modules/prisma/
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=3000
EXPOSE 3000
CMD ["sh", "-c", "npx prisma migrate deploy --schema API/prisma/schema.prisma && node API/dist/server.js"]