Skip to content

Commit fd74970

Browse files
committed
update dockerfile
1 parent e5208d8 commit fd74970

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM node:16-alpine3.15 as builder
2+
3+
VOLUME [ "/data" ]
4+
5+
ARG DB_TYPE=sqlite
6+
ENV DB_TYPE=$DB_TYPE
7+
8+
RUN apk add --no-cache python3 py3-pip make gcc g++
9+
10+
COPY . /app
11+
12+
COPY package.json yarn.lock /app/
13+
14+
WORKDIR /app
15+
16+
RUN npm install -g pnpm
17+
RUN pnpm i
18+
RUN npm run build:without-migrate
19+
20+
FROM node:16-alpine3.15 as runner
21+
22+
ENV NODE_ENV=production
23+
ARG DB_TYPE=sqlite
24+
ENV DB_TYPE=$DB_TYPE
25+
26+
WORKDIR /app
27+
28+
COPY --from=builder /app/node_modules ./node_modules
29+
COPY --from=builder /app/public ./public
30+
COPY --from=builder /app/.next ./.next
31+
COPY . /app
32+
33+
EXPOSE 3000/tcp
34+
35+
CMD ["npm", "run", "start:with-migrate"]

0 commit comments

Comments
 (0)