-
Notifications
You must be signed in to change notification settings - Fork 0
set api url in dockerfile #90
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,12 @@ | ||||||
| FROM node:22-slim AS base | ||||||
|
|
||||||
| LABEL org.opencontainers.image.source=https://github.com/ssciwr/onehealth-frontend | ||||||
| LABEL org.opencontainers.image.description="Onehealth Frontend" | ||||||
| LABEL org.opencontainers.image.source=https://github.com/ssciwr/heiplanet-frontend | ||||||
| LABEL org.opencontainers.image.description="Heiplanet Frontend" | ||||||
| LABEL org.opencontainers.image.licenses=MIT | ||||||
|
|
||||||
| ENV PNPM_HOME="/pnpm" | ||||||
| ENV PATH="$PNPM_HOME:$PATH" | ||||||
| ENV VITE_NUTS_API_BASE="http://api:8000" | ||||||
|
||||||
| ENV VITE_NUTS_API_BASE="http://api:8000" | |
| ENV VITE_NUTS_API_BASE="/api" |
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.
I also think this could work to connect the frontend and backend in production (but as the one cartesian request was/is already working, then changing doesn't make so much sense. I can make the NUTS request use the same approach as the backend one to avoid this issue, if the cartesian one is working now?)
Copilot
AI
Feb 26, 2026
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.
The RUN command explicitly passes VITE_NUTS_API_BASE to the build, but since it's already defined as an ENV earlier in the same stage, this is redundant. The environment variable will already be available to the build process.
Consider simplifying to: RUN pnpm build
However, this may be intentional for clarity or to allow build-time overrides via build args.
| RUN VITE_NUTS_API_BASE=$VITE_NUTS_API_BASE pnpm build | |
| RUN pnpm build |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| services: | ||||||
| frontend: | ||||||
| image: ghcr.io/ssciwr/onehealth-map-frontend:latest | ||||||
| image: ghcr.io/ssciwr/heiplanet-frontend:main | ||||||
|
||||||
| image: ghcr.io/ssciwr/heiplanet-frontend:main | |
| image: ghcr.io/ssciwr/heiplanet-frontend:latest |
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.
The vite.config.ts sets the base path using the VITE_BASE_PATH environment variable (defaulting to "/"), but this environment variable is not set in the Dockerfile. The nginx configuration serves the app from /heiplanet-frontend/, which suggests VITE_BASE_PATH should be set to "/heiplanet-frontend/" to ensure proper asset loading and routing.
Add: ENV VITE_BASE_PATH="/heiplanet-frontend/"
Without this, the built application will look for assets at the wrong paths (e.g., /assets/... instead of /heiplanet-frontend/assets/...).