-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (31 loc) · 900 Bytes
/
Dockerfile
File metadata and controls
45 lines (31 loc) · 900 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
36
37
38
39
40
41
42
43
44
45
# syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base
# install deps
FROM base AS deps
WORKDIR /app
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN corepack enable pnpm && pnpm i --frozen-lockfile
# build stage
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# no build step, but need source files and modules
RUN corepack enable pnpm
# prod image
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 expressjs
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/src ./src
COPY ./certs /certs
ENV SSL_KEY=/certs/scalereach.team.key
ENV SSL_CERT=/certs/scalereach.team.pem
USER expressjs
EXPOSE 6732
ENV PORT=6732
ENV HOSTNAME="0.0.0.0"
CMD ["node", "src/server.js"]