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

feat: add dockerfile for dev environment #160

Closed
wants to merge 12 commits into from
Closed

feat: add dockerfile for dev environment #160

wants to merge 12 commits into from

Conversation

irving-caamal
Copy link

@irving-caamal irving-caamal commented Oct 10, 2021

Feature: add Dockerfile and docker-compose file to manage production and development environment

Hi I've created a docker-compose-dev.yml file to manage different environments for the frontend

  • I've tried to build and run the frontend app with Parcel, unfortunately, I cannot do that.

  • So I just run the frontend app in development mode.

  • You can set the build and run scripts in the package JSON and change the yarn dev instruction for yarn start in the Dockerfile

  • Create docker-compose file and add Dockerfile.dev for dev environment

  • Separate the node image in bundle and run

  • Build and run the app in production mode run the app in dev mode into production docker-compose

  • Add documentation of how to use both environments

Resolve #99

Hope this can help the project. thanks for the time

@galbwe galbwe self-requested a review October 11, 2021 13:24
@galbwe
Copy link
Collaborator

galbwe commented Oct 11, 2021

I've tried to build and run the frontend app with Parcel, unfortunately, I cannot do that.

What issues did you run into?

@irving-caamal
Copy link
Author

irving-caamal commented Oct 11, 2021

I've tried to build and run the frontend app with Parcel, unfortunately, I cannot do that.

What issues did you run into?

Hi @galbwe, well the app gets to build with no errors in the dist directory but when you try to run it, it throws a Parcel error 'cause can't load the .js files created, that's the reason I just put the same yarn dev on the Dockerfile for production

I try these steps with no success.

  1. I set type="module" when loading the js script in the index.html (requested by parcel)
  2. I set the scripts build and start you can check it here
    2. build. parcel build src/index.html
    2. start. parcel dist/index.html
  3. Everything looks good on the build but when you run the start script it crashes with a Parcel message that says can't load .js files

README.md Outdated Show resolved Hide resolved
frontend/Dockerfile Outdated Show resolved Hide resolved
remove `yarn build` comment
set docker-composer-dev.yml file on development mode instruction
@irving-caamal
Copy link
Author

thanks for your time @galbwe 🤝

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerize React app
2 participants