Skip to content

Commit

Permalink
πŸ’š dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
no-ikjun committed Feb 6, 2024
1 parent 4d296a1 commit 13bd938
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Step 1: Build the app in image 'builder'
FROM node:18-alpine AS builder

WORKDIR /app

COPY package.json package-lock.json ./

RUN apk update && \
apk add build-base libheif vips-dev vips -q
RUN npm install --platform=linuxmusl

COPY . .

RUN npx prisma generate

RUN npm run build

#Step 2: Copy the build from 'builder' to 'runner'
FROM node:18-alpine

WORKDIR /app

ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apk update && \
apk add build-base libheif vips-dev vips -q

COPY --from=builder /app ./

RUN npm install -D prisma --platform=linuxmusl

EXPOSE 3000

CMD ["npm", "run", "start:deploy"]

0 comments on commit 13bd938

Please sign in to comment.