forked from runtipi/runtipi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (34 loc) · 1001 Bytes
/
Dockerfile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ARG NODE_VERSION="18.12.1"
ARG ALPINE_VERSION="3.16"
FROM node:${NODE_VERSION}-buster-slim AS node_base
RUN apt update
RUN apt install -y openssl
FROM node_base AS builder_base
RUN npm install node-gyp -g
RUN npm install pnpm -g
# BUILDER
FROM builder_base AS builder
WORKDIR /app
COPY ./pnpm-lock.yaml ./
RUN pnpm fetch
COPY ./package*.json ./
COPY ./prisma/schema.prisma ./prisma/
RUN pnpm install -r --prefer-offline
COPY ./src ./src
COPY ./esbuild.js ./esbuild.js
COPY ./tsconfig.json ./tsconfig.json
COPY ./next.config.mjs ./next.config.mjs
COPY ./public ./public
RUN npm run build
# APP
FROM node_base AS app
# USER node
WORKDIR /app
COPY --from=builder /app/dist ./
COPY --from=builder /app/next.config.mjs ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder --chown=node:node /app/.next/standalone ./
COPY --from=builder --chown=node:node /app/.next/static ./.next/static
EXPOSE 3000
CMD ["npm", "run", "start"]