Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
djyde committed Oct 13, 2024
1 parent e5208d8 commit fd74970
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM node:16-alpine3.15 as builder

VOLUME [ "/data" ]

ARG DB_TYPE=sqlite
ENV DB_TYPE=$DB_TYPE

RUN apk add --no-cache python3 py3-pip make gcc g++

COPY . /app

COPY package.json yarn.lock /app/

WORKDIR /app

RUN npm install -g pnpm
RUN pnpm i
RUN npm run build:without-migrate

FROM node:16-alpine3.15 as runner

ENV NODE_ENV=production
ARG DB_TYPE=sqlite
ENV DB_TYPE=$DB_TYPE

WORKDIR /app

COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY . /app

EXPOSE 3000/tcp

CMD ["npm", "run", "start:with-migrate"]

0 comments on commit fd74970

Please sign in to comment.