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 values do not persist between build stages.
More info:
moby/moby#37345 (comment)
  • Loading branch information
ruohola committed Oct 31, 2020
1 parent bad89d0 commit 0747b57
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Expand Up @@ -17,19 +17,17 @@ 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 . .

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


FROM circleci as prod

ARG API_URL

RUN yarn build

CMD ["yarn", "start"]

0 comments on commit 0747b57

Please sign in to comment.