Skip to content

Commit

Permalink
API: use a variable for container version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
XeR committed May 29, 2022
1 parent 464206b commit c4c7159
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

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

################################################################################
# Build stage 1 - `yarn build`

FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 as builder
FROM node@${NODE_DIGEST} as builder
# Import our shared args
ARG NODE_ENV

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

FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 as clean
FROM node@${NODE_DIGEST} as clean
# Import our shared args
ARG NODE_ENV

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

FROM node@sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10
FROM node@${NODE_DIGEST}
# Import our shared args
ARG NODE_ENV

Expand Down

0 comments on commit c4c7159

Please sign in to comment.