Skip to content

running build minified artifact#23

Open
ffabinhoo wants to merge 1 commit intomainfrom
wallet-ui-dockerfile
Open

running build minified artifact#23
ffabinhoo wants to merge 1 commit intomainfrom
wallet-ui-dockerfile

Conversation

@ffabinhoo
Copy link
Copy Markdown
Contributor

This change represents a minor enhancement, leveraging the minified version generated by 'npm run build' using the external .env file.

Comment thread Dockerfile-frontend
EXPOSE 8090

CMD ["sh","-c","npm start"]
CMD ["sh", "-c", "npm run build && serve -s build -l 8090"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the npm run build part outside of the CMD section? The build output should be created once during the creation of the image, that way when we deploy the container we do not have to build it again. The build might fail at run time as we have not yet tested it until then. Also, the output of npm run build could change at run time as new versions of the dependencies are released and it downloads these newer versions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading the documentation I saw that after building a react app all code is static and can't be changed.
Here is the documentation:
https://create-react-app.dev/docs/adding-custom-environment-variables/

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

Successfully merging this pull request may close these issues.

2 participants