- Notifications
You must be signed in to change notification settings - Fork 452
🔧(docker) add a service in compose to frontend development #1033
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new Docker Compose service for frontend development to enable hot reload by mounting local sources, and updates Makefile targets to use that service.
- Introduces
frontend-developmentservice in docker-compose with build args, volume mount, and port mapping - Updates Makefile
runalias to start the dev service instead of production frontend, and adjustsrun-frontend-developmentto stop containers before launching
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docker-compose.yml | Expose production frontend image/ports and add frontend-development service with build, volume, ports |
| Makefile | Change run to bring up frontend-development and update run-frontend-development stop logic |
Comments suppressed due to low confidence (2)
docker-compose.yml:174
- The
imagekey forfrontend-developmentis indented with 6 spaces, but service-level keys should use 4 spaces. This misalignment can cause a YAML parse error.
image: impress:frontend-development Makefile:319
- The
run-frontend-developmenttarget stops both services but never starts thefrontend-developmentcontainer. To leverage the new Compose service for hot reload, add@$(COMPOSE) up --force-recreate -d frontend-developmentbefore runningyarn dev.
cd $(PATH_FRONT_IMPRESS) && yarn dev 2a4510e to 118a5ae Compare 0adb6c0 to ca7055d Compare We want a serice in compose starting the frontend application in development mode. We want to take the advantage of the hot reload module, so the sources are mounted inside the container.
`app` and `celery` services are not used when we run the compose configuration. The compose file is only used for development purpose.
To have a better developer experience, the y-provider service run in dev mode, allowing hot reload when a file is modified. To avoid issue with shared node_modules, they are mounted in a separated volume to not have then in the local directory.
The usage of docker-compose.yaml file is deprecated, we can rename it in compose.yml
We want to run the e2e tests using the frontend and y-provider production images. We created a dedicated compose file adding just missing services. These services are built in the CI.
ca7055d to 35c7b9e Compare In order to speed the rebuild of images, the --no-cache option is removed by default. If we want to build the images without cache, the cache paramter must be used.
Without this, YdocConverter throws an error when developping.
35c7b9e to f97ab51 Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good !
Purpose
When a new user come on the project, clone it and run
make bootstrap, he is able to test the project but not starting directly to work on it, he also have to install all the frontend dependencies on its machine and then run the frontend application outside of the compose stack. Installing frontend dependencies is quite expensive and it has already made during the bootstrap but not reusable.We change the strategy in this PR, the
make bootstrapbuild all the images in frontend mode, there is no need anymore to re-install all frontend dependencies and run the frontend application outside the compose stack.The legacy behaviour is maintained, you can still run only the backend application with compose and the frontend using your local node installation.