Skip to content

Commit c4c7159

Browse files
committed
API: use a variable for container version
API uses the same container 3 times. This commit specifies the version of the container in a variable that gets reused in the Dockerfile. This makes sure we don't forget to update any of the containers.
1 parent 464206b commit c4c7159

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
# Global args, set before the first FROM, shared by all stages
44
ARG NODE_ENV="production"
5+
ARG NODE_DIGEST="sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10"
56

67
################################################################################
78
# Build stage 1 - `yarn build`
89

9-
FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 as builder
10+
FROM node@${NODE_DIGEST} as builder
1011
# Import our shared args
1112
ARG NODE_ENV
1213

@@ -24,7 +25,7 @@ RUN yarn run build
2425
################################################################################
2526
# Build stage 2 - COPY the relevant things (multiple steps)
2627

27-
FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 as clean
28+
FROM node@${NODE_DIGEST} as clean
2829
# Import our shared args
2930
ARG NODE_ENV
3031

@@ -36,7 +37,7 @@ COPY --from=builder /app/migrations/ /app/migrations/
3637
################################################################################
3738
# Build stage FINAL - COPY everything, once, and then do a clean `yarn install`
3839

39-
FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10
40+
FROM node@${NODE_DIGEST}
4041
# Import our shared args
4142
ARG NODE_ENV
4243

0 commit comments

Comments
 (0)