-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
37 lines (26 loc) · 801 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
### Build Step
# pull the Node.js Docker image
FROM node:fermium-alpine3.15 as builder
# Install pnpm
RUN npm install -g pnpm
WORKDIR /usr/src/app
# Install build dependencies
COPY .npmrc package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Bundle app source
COPY . .
# build the application
RUN pnpm build
FROM node:fermium-alpine3.15
# Install pnpm
RUN npm install -g pnpm
WORKDIR /usr/src/app
# Install production dependencies
COPY --from=builder /usr/src/app/.npmrc /usr/src/app/package.json /usr/src/app/pnpm-lock.yaml ./
RUN pnpm install --prod --frozen-lockfile
COPY migrations/ /usr/src/app/migrations
COPY --from=builder /usr/src/app/build ./build
RUN mkdir -p /usr/src/app/db
EXPOSE 3000
# the command that starts our app
CMD ["node", "/usr/src/app/build/index.js"]