-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
77 lines (54 loc) · 2.11 KB
/
Copy pathDockerfile
File metadata and controls
77 lines (54 loc) · 2.11 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM node:22-alpine as build
RUN apk --no-cache add --update git python3 g++
WORKDIR /app
ENV GENERATE_SOURCEMAP false
ENV NODE_ENV production
ENV SKIP_ENV_VALIDATION true
ARG NEXT_PUBLIC_ALEO_NETWORK
ENV NEXT_PUBLIC_ALEO_NETWORK $NEXT_PUBLIC_ALEO_NETWORK
ARG NEXT_PUBLIC_WS_URL
ENV NEXT_PUBLIC_WS_URL $NEXT_PUBLIC_WS_URL
# package files
COPY .yarn/ ./.yarn/
COPY .yarnrc.yml ./.yarnrc.yml
COPY yarn.lock ./yarn.lock
COPY package.json ./package.json
COPY .pnp.cjs ./.pnp.cjs
COPY .pnp.loader.mjs ./.pnp.loader.mjs
# config files
COPY drizzle.config.ts ./drizzle.config.ts
COPY next.config.mjs ./next.config.mjs
COPY tsconfig.json ./tsconfig.json
COPY tsconfig.server.json ./tsconfig.server.json
COPY .eslintrc.cjs ./.eslintrc.cjs
# migrations
COPY migrations/ ./migrations/
# src and public files
COPY public/ ./public/
COPY src/ ./src/
RUN yarn install --silent
RUN yarn build
FROM node:22-alpine as run
RUN apk --no-cache add busybox
WORKDIR /app
ENV NODE_ENV production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
COPY --from=build --chown=nextjs:nodejs /app/.next ./.next
COPY --from=build --chown=nextjs:nodejs /app/dist/ ./dist/
COPY --from=build --chown=nextjs:nodejs /app/public/ ./public/
COPY --from=build --chown=nextjs:nodejs /app/src/ ./src/
COPY --from=build --chown=nextjs:nodejs /app/migrations/ ./migrations/
COPY --from=build --chown=nextjs:nodejs /app/.yarn/ ./.yarn/
COPY --from=build --chown=nextjs:nodejs /app/.yarnrc.yml ./.yarnrc.yml
COPY --from=build --chown=nextjs:nodejs /app/yarn.lock ./yarn.lock
COPY --from=build --chown=nextjs:nodejs /app/package.json ./package.json
COPY --from=build --chown=nextjs:nodejs /app/.pnp.cjs ./.pnp.cjs
COPY --from=build --chown=nextjs:nodejs /app/.pnp.loader.mjs ./.pnp.loader.mjs
COPY --from=build --chown=nextjs:nodejs /app/drizzle.config.ts ./drizzle.config.ts
COPY --from=build --chown=nextjs:nodejs /app/next.config.mjs ./next.config.mjs
COPY --from=build --chown=nextjs:nodejs /app/tsconfig.json ./tsconfig.json
COPY --from=build --chown=nextjs:nodejs /app/tsconfig.server.json ./tsconfig.server.json
USER nextjs
EXPOSE 3000
CMD ["yarn", "start:prod"]