Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile in client - important nuance! If you see an nginx web page instead of React App #20

Open
hazartilirot opened this issue Jan 7, 2022 · 0 comments

Comments

@hazartilirot
Copy link

hazartilirot commented Jan 7, 2022

In case you're wondering I use the latest version of everything up to date. As an example I wrote my code utilizing async/await, functional component against of class component. The code would be available in one of my repos. I cannot explain the reason causing the behaviour if a previous deployment allowed to use multi stage builds in one file - I had no issues with the previous project. This one is just doesn't want to copy files from the build/ directory and I don't know how to trace a reason. Logs didn't show any sign of an error.

**--from=0** this command says copy artifacts from <dir> to <dir>

FROM node:16.13.1-alpine
WORKDIR /app
COPY ["package*.json", "./"]
RUN npm install
COPY . .
RUN npm run build

FROM nginx:1.21.5-alpine
EXPOSE 3000
COPY --from=0 /app/build /usr/share/nginx/html
COPY ./nginx/default.conf ./etc/nginx/conf.d/default.conf

If you're interested, here is my repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant