-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
47 lines (35 loc) · 1.09 KB
/
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
FROM node:20 AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
FROM node:20 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED 1
RUN apt-get update && apt-get install -y jq
RUN yarn build
FROM node:20 AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/public ./public
COPY --from=builder /app/server.js ./server.js
COPY --from=builder /app/apis ./apis
COPY --from=builder /app/tools ./tools
COPY --from=builder /app/db ./db
COPY --from=builder /app/helpers ./helpers
USER nextjs
EXPOSE 8080
ENV PORT 8080
ENV NODE_ENV production
ENV GITHUB_CLIENT_ID e6831840d043f12bfa06
ENV NEXT_PUBLIC_BASE_URL https://zemuldo.com
ENV NEXT_PUBLIC_API_URL https://zemuldo.com/api
ENV NEXT_PUBLIC_STATIC_IMAGES_URL https://static.zemuldo.com/images
CMD ["npm", "start"]