build error
bruciebruce opened this issue · 4 comments
Ran the deploy script. Got this error:
Removing intermediate container 94872dedc0c2
---> e119249488d9
Step 13/20 : RUN rm -rf /usr/share/nginx/html/*
---> Running in f370e22dbbf6
Removing intermediate container f370e22dbbf6
---> bc78a25eac95
Step 14/20 : COPY --from=builder /usr/src/reactapp/docker/nginx.conf /etc/nginx/nginx.conf
---> f02300ec92d8
Step 15/20 : COPY --from=builder /usr/src/reactapp/docker/nginxconfig/general.conf /etc/nginx/general.conf
---> 3686164125a3
Step 16/20 : COPY --from=builder /usr/src/reactapp/docker/nginxconfig/security.conf /etc/nginx/security.conf
---> ca02719af3d2
Step 17/20 : COPY --from=builder /usr/src/reactapp/build /usr/share/nginx/html
---> 906dfe278f0b
Step 18/20 : COPY --from=builder /usr/src/reactapp/.env /usr/share/nginx/html/.env
COPY failed: stat usr/src/reactapp/.env: file does not exist
ERROR: Service 'reactapp_svc' failed to build : Build failed
I commented this lilne out.
Yeah, that's because you had no environment variable file setup. If you comment it out it means you don't want to use an environment variable file for all your variables and have resorted to hardcode them in the codebase or are using a CI/CD pipeline to hanldle that.
I have got the same error, which line needs to be commented?
This line COPY --from=builder /usr/src/reactapp/.env /usr/share/nginx/html/.env. Only comment/remove it out if you do not have a .env file in the root directory.