Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
Fix Dockerfile API_URL ARG not working in prod
Browse files Browse the repository at this point in the history
The reason for this was that ARG valus do not persist between build stages.
moby/moby#37345 (comment)
  • Loading branch information
ruohola committed Oct 31, 2020
1 parent bad89d0 commit 1e44a82
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Expand Up @@ -17,19 +17,21 @@ CMD ["yarn", "dev"]

FROM dev AS circleci

# Needs to be during `yarn build`. Will be an empty string in circleci
# and gets an actual value when building prod image.
ARG API_URL

COPY --chown=user:user . .

# Needs to be defined during `yarn build`.
# Will be an empty string in circleci and gets an actual value when building prod image.
ARG API_URL

CMD yarn lint \
&& yarn type-check \
&& yarn build


FROM circleci as prod

ARG API_URL

RUN yarn build

CMD ["yarn", "start"]

0 comments on commit 1e44a82

Please sign in to comment.