-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (26 loc) · 821 Bytes
/
Dockerfile
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
FROM node:18-alpine AS builder
ARG CACHEBUST=1
# Set the working directory to /app
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install the project dependencies
RUN npm install
# Copy the rest of the application code to the working directory
COPY . .
RUN npm run prisma:generate
#RUN npm i -g prisma
RUN npm run build
# Expose the port that the application will listen on
#EXPOSE 8000
# Start the application
#CMD ["startup.sh"]
# 2nd step, to run migrations
FROM node:18-alpine
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist
# 👇 copy prisma directory
COPY --from=builder /app/src/database ./src/database
EXPOSE 8000
CMD [ "npm", "run", "start:migrate:prod" ]