Skip to content

Make UI dev docker image self-sufficient #836

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

f-PLT
Copy link
Contributor

@f-PLT f-PLT commented May 7, 2025

Summary

Fixes comments from previous PR #829 .

List of Changes

  • Makes the base UI Docker self-sufficient
  • Add a try/catch to vite.config to identify clearly when a local docker image is used for the frontend

Detailed Description

As suggested, the UI docker approach is now completely self-sufficient and separated from a developer's local development setup for the UI.

A developer wanting to work on the UI with docker now doesn't need to have Node installed locally at all (although at some point it still is worth it to do so). A developer working locally will have node/yarn installed locally should see their workflow stays the same as before.

The change proposed to ui/vite.config.ts is because currently, building the UI requires access to the commit history to tag each build. While copying the .git folder at build time could work, it would also have required to change the whole build context of the UI service, remove the ui/ folder from the main .dockerignore and possibly refactor all the other docker files in the project to make sure no adverse effects came of such a change.

Since we are considering reworking the docker files soon anyway, I figured it wasn't worth the trouble right now. It does also have the benefit of clearly signaling that a pre-build docker image is being used and reminds the user to make sure to rebuild the image when necessary.

image

Using the optional compose override still displays the appropriate build number, like before.

How to Test the Changes

  1. Standard development: will use a pre-built version of the frontend that will not have hot-reloading enabled, but will make startup time faster when restarting the stack.
# Start the whole compose stack
docker compose up -d

# To stream the logs
docker compose logs -f django celeryworker ui
# Ctrl+c to close the logs

If there's a need to update the frontend while the compose stack is running, use the following command to rebuild the frontend and load the new changes
(and remember to refresh your browser after!).

docker compose stop ui && docker compose build ui &&  docker compose up ui -d
  1. With Hot Reload UI: Hot reload is enabled for frontend development, but the primary web interface will be slow to load at startup and later restarts.
# Run docker compose with the override config
docker compose -f docker-compose.yml -f docker-compose-frontend-dev.override.yml up -d

Screenshots

N/A

Deployment Notes

Potentially worth to make sure that the changes to vite.config.ts do not cause unforeseen problems with the Netlify deployment structure

Checklist

  • I have tested these changes appropriately.
  • I have added and/or modified relevant tests.
  • I updated relevant documentation or comments.
  • I have verified that this PR follows the project's coding standards.
  • Any dependent changes have already been merged to main.

@f-PLT f-PLT requested a review from mihow May 7, 2025 18:40
@f-PLT f-PLT self-assigned this May 7, 2025
Copy link

netlify bot commented May 7, 2025

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit eb38b45
🔍 Latest deploy log https://app.netlify.com/sites/antenna-preview/deploys/681baaa21df564000859e181

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.

1 participant