-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (24 loc) · 898 Bytes
/
Dockerfile
File metadata and controls
39 lines (24 loc) · 898 Bytes
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
ARG NODE_VERSION=22.13.1
FROM node:${NODE_VERSION}-alpine AS base
ARG PORT=3000
WORKDIR /app
RUN apk add --no-cache bash
FROM base AS builder
WORKDIR /app
COPY --link package.json yarn.lock ./
RUN yarn install --pure-lockfile --non-interactive
COPY . .
RUN yarn prisma-chatbot-db:generate
RUN NODE_ENV=production yarn build
FROM base
COPY --from=builder /app/.output /app/.output
COPY devops-toolbox/scripts/secrets-entrypoint.sh ./secrets-entrypoint.sh
RUN yarn init -y
RUN yarn add prisma
RUN yarn add dotenv
COPY --from=builder /app/prisma-chatbot-db/prisma-config.ts ./prisma-chatbot-db/prisma-config.ts
COPY --from=builder /app/prisma-chatbot-db/schema.prisma ./prisma-chatbot-db/schema.prisma
COPY --from=builder /app/prisma-chatbot-db/migrations ./prisma-chatbot-db/migrations
EXPOSE ${PORT}
ENTRYPOINT [ "./secrets-entrypoint.sh" ]
CMD [ "node", ".output/server/index.mjs" ]