-
-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (22 loc) · 663 Bytes
/
Dockerfile
File metadata and controls
35 lines (22 loc) · 663 Bytes
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
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 yarn install --frozen-lockfile && npx browserslist@latest --update-db
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"]