-
Notifications
You must be signed in to change notification settings - Fork 2
🐛 bug: Nginx does not route correctly using the docker image #96
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
Merged
MaartendeKruijf
merged 5 commits into
development
from
bugfix/95-nginx-does-not-route-correctly-using-the-docker-image
Feb 25, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
44dce10
🐛 bugfix: Fix nginx routing
Paul2803k 209de9b
🎨 refactor: adapt vite server to the nginx config
Paul2803k 304ab22
📝 doc: update README
Paul2803k 2b07cbf
🐛 fix: remove legacy index
Paul2803k e4fb375
Merge branch 'development' into bugfix/95-nginx-does-not-route-correc…
Paul2803k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| npm-debug.log | ||
| node_modules | ||
| dist | ||
| .git | ||
| npm-debug.log | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| .dockerignore | ||
| .git | ||
| .gitignore | ||
| .env | ||
| .env | ||
| .env.example | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,27 @@ | ||
| VITE_SOARCA_URI=http://localhost:8080 # for vite each env var must start with VITE_ otherwise it won't be exposed to the client side | ||
| # .env.example — example environment variables for SOARCA-GUI | ||
| # Copy this file to `.env.development` for local dev or to `.env` for Docker Compose | ||
| # Notes: | ||
| # - Vite exposes ONLY variables prefixed with `VITE_` to the client (import.meta.env). | ||
| # - Client-visible `VITE_` values are embedded at *build time* (rebuild to change). | ||
| # - Docker Compose reads the project `.env` for substitution and container envs. | ||
| # - We also follow a consumer based prefix convention for clarity, so variables used by nginx start with NGINX_, those used by the dev server start with VITE_ etc. | ||
|
|
||
| ########## Development (Vite) ########## | ||
| # Used by `npm run dev` / Vite dev server. Client-facing variables MUST start with VITE_. | ||
| # copy these lines into `.env.development` or `.env` (see Vite docs at https://vite.dev/guide/env-and-mode) and adjust as needed for local development | ||
| VITE_BACKEND_URL=http://localhost:8080 # backend API URL used by the frontend (dev server proxy target) | ||
| VITE_SERVER_PORT=5173 # dev server port | ||
|
|
||
| ########## Docker Compose (dev) ########## | ||
| # Values used by `docker-compose.dev.yml`. Compose will substitute ${VAR} from the | ||
| # project `.env` or the shell environment when you run `docker compose`. | ||
| VITE_APP_VERSION=development | ||
| VITE_BACKEND_URL=http://host.docker.internal:8080 # backend API URL used by the frontend inside the container (host.docker.internal points to the host machine) | ||
| VITE_SERVER_PORT=5173 # dev server port inside the container | ||
| DOCKER_HOST_PORT=5173 # port on the host machine mapped to the container's VITE_SERVER_PORT (for browser access) | ||
|
|
||
| ########## Production (nginx) ########## | ||
| # Values used at container runtime by nginx to proxy /api/ | ||
| NGINX_BACKEND_URL=http://host.docker.internal:8080/ # backend API URL used by nginx inside the container (host.docker.internal points to the host machine) | ||
| NGINX_SERVER_PORT=8081 # port nginx listens on inside the container | ||
| DOCKER_HOST_PORT=8081 # port on the host machine mapped to the container's NGINX_SERVER_PORT (for browser access) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,15 @@ | ||
| # Stage 1: Development environment | ||
| FROM node:24-alpine AS development | ||
| # Install dependencies and build the application | ||
| FROM node:24-alpine AS builder | ||
| RUN apk add --no-cache git | ||
| WORKDIR /app | ||
| COPY package*.json ./ | ||
| RUN npm install --include=dev | ||
| EXPOSE 3000 | ||
| CMD ["npm", "run", "dev"] | ||
|
|
||
| # Stage 2: Build for production | ||
| FROM development AS builder | ||
| RUN npm install | ||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| # Stage 3: Production environment | ||
| # Serve with nginx | ||
| FROM nginx:alpine AS production | ||
| COPY nginx.conf /etc/nginx/templates/default.conf.template | ||
| COPY --from=builder /app/dist /usr/share/nginx/html | ||
| EXPOSE 80 | ||
| EXPOSE 8081 | ||
| CMD ["nginx", "-g", "daemon off;"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Install (dev) dependencies and run development server | ||
| # NOTE: we install git to allow the versioning of the application to be included in the build (e.g., for display in the UI) | ||
| FROM node:24-alpine | ||
| RUN apk add --no-cache git | ||
| WORKDIR /app | ||
| COPY package*.json ./ | ||
| RUN npm install --include=dev | ||
| EXPOSE 5173 | ||
| CMD ["npm", "run", "dev"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.