Skip to content

Commit

Permalink
add docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed Mar 7, 2024
1 parent cdd2259 commit cdfabe4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
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 cdfabe4

Please sign in to comment.