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

Add traefik to compose #418

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Setting the compose profiles spins up the matching services. To create all of th
docker compose --profile '*' up -d
```

You can then go to `http://localhost` to access the UI and `http://localhost:3000/explorer` to access the backend Swagger UI (including the openAPI specs). To login use:
You can then go to `http://localhost` to access the UI and `http://localhost/api/v1/explorer` to access the backend Swagger UI (including the openAPI specs). To login use:

| Username | Password |
| ---------------- | ------------- |
Expand Down
24 changes: 17 additions & 7 deletions config/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: "3.9"
services:
reverse-proxy:
image: traefik:3.2
command: --api.insecure=true --providers.docker=true --entrypoints.web.address=:80
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock

mongodb:
image: mongo:4.2
volumes:
Expand Down Expand Up @@ -45,20 +52,23 @@ services:
JWT_SECRET: jwt_secret
CHROME_BIN: /usr/bin/chromium
CHROME_PATH: /usr/lib/chromium/
BASE_PATH: /api/v1
profiles:
- be
ports:
- 3000:3000
labels:
- traefik.http.routers.backend.rule=PathPrefix(`/api/v1`)

frontend:
image: ghcr.io/paulscherrerinstitute/scilog/fe
# volumes:
# uncomment to enable the oidc form
volumes:
# replace simple_config.json volume mount
# with the one below to enable the oidc form
# - ./fe/config.json:/usr/share/nginx/html/assets/config.json
- ./fe/simple_config.json:/usr/share/nginx/html/assets/config.json
profiles:
- fe
ports:
- 80:80
labels:
- traefik.http.routers.frontend.rule=PathPrefix(`/`)

volumes:
mongodb_data:
Expand Down
2 changes: 1 addition & 1 deletion config/fe/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lbBaseURL": "http://localhost:3000/",
"lbBaseURL": "http://localhost/api/v1/",
"oAuth2Endpoint": {
"authURL": "auth/keycloak",
"displayText": "keycloak"
Expand Down
3 changes: 3 additions & 0 deletions config/fe/simple_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lbBaseURL": "http://localhost/api/v1/"
}