File tree 3 files changed +42
-16
lines changed
3 files changed +42
-16
lines changed Original file line number Diff line number Diff line change @@ -48,19 +48,3 @@ COPY --chown=node:node . .
48
48
COPY --from=base --chown=node:node /app/node_modules ./node_modules
49
49
50
50
RUN npm run build
51
-
52
- #
53
- # 本番環境向け
54
- #
55
- FROM base AS production
56
-
57
- USER node
58
- WORKDIR /app
59
-
60
- COPY --chown=node:node --from=build /app/.next ./.next
61
- COPY --chown=node:node --from=build /app/public ./public
62
- COPY --chown=node:node --from=build /app/next.config.ts ./next.config.ts
63
- COPY --chown=node:node --from=build /app/package.json ./package.json
64
- COPY --chown=node:node --from=build /app/node_modules ./node_modules
65
-
66
- CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change
1
+ FROM node:22 AS base
2
+
3
+ # Next.js はビルド時に環境変数を参照しているので、
4
+ # 環境変数をビルド時の引数として指定することで環境を切り分ける
5
+ ARG NODE_ENV=""
6
+ ARG DATABASE_URL=""
7
+ ARG TZ="Asia/Tokyo"
8
+ ARG MAPBOX_MAP_STYLE=""
9
+ ARG MAPBOX_ACCESS_TOKEN=""
10
+
11
+ ENV NODE_ENV=${NODE_ENV}
12
+ ENV DATABASE_URL=${DATABASE_URL}
13
+ ENV TZ=${TZ}
14
+ ENV NEXT_PUBLIC_MAPBOX_MAP_STYLE=${MAPBOX_MAP_STYLE}
15
+ ENV NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}
16
+
17
+ USER node
18
+ WORKDIR /app
19
+
20
+ COPY --chown=node:node package.json package-lock.json ./
21
+
22
+ RUN npm ci
23
+
24
+ #
25
+ # 本番環境向け
26
+ #
27
+ FROM base AS production
28
+
29
+ USER node
30
+ WORKDIR /app
31
+
32
+ COPY --chown=node:node --from=build /app/.next ./.next
33
+ COPY --chown=node:node --from=build /app/public ./public
34
+ COPY --chown=node:node --from=build /app/next.config.ts ./next.config.ts
35
+ COPY --chown=node:node --from=build /app/package.json ./package.json
36
+ COPY --chown=node:node --from=build /app/node_modules ./node_modules
37
+
38
+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change 6
6
proxy_pass http://akane-next:3000/admin;
7
7
}
8
8
9
+ location /_next {
10
+ proxy_pass http://akane-next:3000;
11
+ }
12
+
9
13
}
You can’t perform that action at this time.
0 commit comments