Skip to content

Commit 159ded0

Browse files
committed
feat(templates): update Dockerfile to use boringcodes/prod-builder as builder base image
1 parent c8dbae8 commit 159ded0

File tree

5 files changed

+50
-40
lines changed

5 files changed

+50
-40
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Base Image GitHub https://github.com/boringcodes/dev-runner
2-
# Default WORKDIR /app
3-
# Default CMD yarn dev
1+
# https://github.com/boringcodes/prod-builder
42

5-
# builder stage
6-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine as builder
3+
# build stage
4+
FROM boringcodes/prod-builder:node-<%= elementNodeVersion %>-alpine as builder
75
COPY . .
86
RUN yarn && yarn build && yarn purge && yarn --production
97

10-
# runner stage
11-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine
8+
# run stage
9+
FROM node:<%= elementNodeVersion %>-alpine
10+
ENV NODE_ENV=production \
11+
HOST=0.0.0.0 \
12+
PORT=80
13+
WORKDIR /app
1214
COPY --from=builder /app/build build
1315
COPY --from=builder /app/node_modules node_modules
14-
CMD node build/index.js
16+
CMD node build
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Base Image GitHub https://github.com/boringcodes/dev-runner
2-
# Default WORKDIR /app
3-
# Default CMD yarn dev
1+
# https://github.com/boringcodes/prod-builder
42

5-
# builder stage
6-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine as builder
3+
# build stage
4+
FROM boringcodes/prod-builder:node-<%= elementNodeVersion %>-alpine as builder
75
COPY . .
86
RUN yarn && yarn build && yarn purge && yarn --production
97

10-
# runner stage
11-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine
8+
# run stage
9+
FROM node:<%= elementNodeVersion %>-alpine
10+
ENV NODE_ENV=production \
11+
HOST=0.0.0.0 \
12+
PORT=80
13+
WORKDIR /app
1214
COPY --from=builder /app/build build
1315
COPY --from=builder /app/node_modules node_modules
14-
CMD node build/index.js
16+
CMD node build
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Base Image GitHub https://github.com/boringcodes/dev-runner
2-
# Default WORKDIR /app
3-
# Default CMD yarn dev
1+
# https://github.com/boringcodes/prod-builder
42

5-
# builder stage
6-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine as builder
3+
# build stage
4+
FROM boringcodes/prod-builder:node-<%= elementNodeVersion %>-alpine as builder
75
COPY . .
86
RUN yarn && yarn build && yarn purge && yarn --production
97

10-
# runner stage
11-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine
8+
# run stage
9+
FROM node:<%= elementNodeVersion %>-alpine
10+
ENV NODE_ENV=production \
11+
HOST=0.0.0.0 \
12+
PORT=80
13+
WORKDIR /app
1214
COPY --from=builder /app/build build
1315
COPY --from=builder /app/node_modules node_modules
14-
CMD node build/index.js
16+
CMD node build
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Base Image GitHub https://github.com/boringcodes/dev-runner
2-
# Default WORKDIR /app
3-
# Default CMD yarn dev
1+
# https://github.com/boringcodes/prod-builder
42

5-
# builder stage
6-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine as builder
3+
# build stage
4+
FROM boringcodes/prod-builder:node-<%= elementNodeVersion %>-alpine as builder
75
COPY . .
86
RUN yarn && yarn build && yarn purge && yarn --production
97

10-
# runner stage
11-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine
8+
# run stage
9+
FROM node:<%= elementNodeVersion %>-alpine
10+
ENV NODE_ENV=production \
11+
HOST=0.0.0.0 \
12+
PORT=80
13+
WORKDIR /app
1214
COPY --from=builder /app/build build
1315
COPY --from=builder /app/node_modules node_modules
14-
CMD node build/index.js
16+
CMD node build
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Base Image GitHub https://github.com/boringcodes/dev-runner
2-
# Default WORKDIR /app
3-
# Default CMD yarn dev
1+
# https://github.com/boringcodes/prod-builder
42

5-
# builder stage
6-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine as builder
3+
# build stage
4+
FROM boringcodes/prod-builder:node-<%= elementNodeVersion %>-alpine as builder
75
COPY . .
86
RUN yarn && yarn build && yarn purge && yarn --production
97

10-
# runner stage
11-
FROM boringcodes/dev-runner:node-<%= elementNodeVersion %>-alpine
8+
# run stage
9+
FROM node:<%= elementNodeVersion %>-alpine
10+
ENV NODE_ENV=production \
11+
HOST=0.0.0.0 \
12+
PORT=80
13+
WORKDIR /app
1214
COPY --from=builder /app/build build
1315
COPY --from=builder /app/node_modules node_modules
14-
CMD node build/index.js
16+
CMD node build

0 commit comments

Comments
 (0)