Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Set up the development compose configuration to be automatically loaded:
ln -s compose.dev.yml compose.override.yml
```

(Note - the main `compose.yml` file is intended for production release)

### Before starting the containers: dev environment setup

Expand Down
27 changes: 27 additions & 0 deletions compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ x-dev-common: &dev-common


services:
ui:
labels:
- "traefik.enable=true"

# local - you may need to tweak this for dev VM's
- "traefik.http.routers.aross-ui.rule=Host(`localhost`) && PathPrefix(`/apps/aross-stations`)"
- "traefik.http.routers.aross-ui.entrypoints=websecure"
- "traefik.http.routers.aross-ui.tls=true"
- "traefik.http.routers.aross-ui.tls.certresolver=letsencrypt"
- "traefik.http.routers.aross-ui.middlewares=aross-ui"
- "traefik.http.routers.aross-ui.service=aross-ui"
- "traefik.http.middlewares.aross-ui.stripprefix.prefixes=/apps/aross-stations"
- "traefik.http.services.aross-ui.loadbalancer.server.port=80"

api:
<<: *dev-common
command: ["dev", "--host", "0.0.0.0", "./src/aross_stations_db/api"]
Expand All @@ -24,6 +38,19 @@ services:
# process:
# docker compose exec api fastapi dev --host 0.0.0.0 ./src/aross_stations_db/api

labels:
- "traefik.enable=true"

# local - you may need to tweak this for dev VM's
- "traefik.http.routers.aross-api.rule=Host(`localhost`) && PathPrefix(`/api/aross-stations`)"
- "traefik.http.routers.aross-api.entrypoints=websecure"
- "traefik.http.routers.aross-api.tls=true"
- "traefik.http.routers.aross-api.tls.certresolver=letsencrypt"
- "traefik.http.routers.aross-api.middlewares=aross-api"
- "traefik.http.routers.aross-api.service=aross-api"
- "traefik.http.middlewares.aross-api.stripprefix.prefixes=/api/aross-stations"
- "traefik.http.services.aross-api.loadbalancer.server.port=8000"

cli:
<<: *dev-common

Expand Down
1 change: 0 additions & 1 deletion compose.integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
labels:
- "traefik.enable=true"

# local
- "traefik.http.routers.aross-api.rule=(Host(`integration.aross-stations.apps.int.nsidc.org`) || Host(`integration.nsidc.org`)) && PathPrefix(`/api/aross-stations`)"
- "traefik.http.routers.aross-api.entrypoints=websecure"
- "traefik.http.routers.aross-api.tls=true"
Expand Down
1 change: 0 additions & 1 deletion compose.qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
labels:
- "traefik.enable=true"

# local
- "traefik.http.routers.aross-api.rule=(Host(`qa.aross-stations.apps.int.nsidc.org`) || Host(`qa.nsidc.org`)) && PathPrefix(`/api/aross-stations`)"
- "traefik.http.routers.aross-api.entrypoints=websecure"
- "traefik.http.routers.aross-api.tls=true"
Expand Down
1 change: 0 additions & 1 deletion compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
labels:
- "traefik.enable=true"

# local
- "traefik.http.routers.aross-api.rule=(Host(`staging.aross-stations.apps.int.nsidc.org`) || Host(`staging.nsidc.org`)) && PathPrefix(`/api/aross-stations`)"
- "traefik.http.routers.aross-api.entrypoints=websecure"
- "traefik.http.routers.aross-api.tls=true"
Expand Down
13 changes: 4 additions & 9 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ services:
labels:
- "traefik.enable=true"

- "traefik.http.routers.aross-ui.rule=Host(`localhost`) && PathPrefix(`/apps/aross-stations`)"
# Production domains (blue, green, and nsidc.org)
- "traefik.http.routers.aross-ui.rule=(Host(`blue.aross-stations.apps.int.nsidc.org`) || Host(`green.aross-stations.apps.int.nsidc.org`) || Host(`nsidc.org`)) && PathPrefix(`/apps/aross-stations`)"
- "traefik.http.routers.aross-ui.entrypoints=websecure"
- "traefik.http.routers.aross-ui.tls=true"
- "traefik.http.routers.aross-ui.tls.certresolver=letsencrypt"
Expand All @@ -49,12 +50,6 @@ services:
- "traefik.http.middlewares.aross-ui.stripprefix.prefixes=/apps/aross-stations"
- "traefik.http.services.aross-ui.loadbalancer.server.port=80"

# Production domain (nsidc.org)
# - "traefik.http.routers.aross-prod.rule=Host(`nsidc.org`) && PathPrefix(`/apps/aross`)"
# - "traefik.http.routers.aross-prod.entrypoints=websecure"
# - "traefik.http.routers.aross-prod.tls.certresolver=letsencrypt"
# - "traefik.http.routers.aross-prod.middlewares=strip-aross-path"

restart: unless-stopped
profiles: ["ui"]

Expand All @@ -71,8 +66,8 @@ services:
labels:
- "traefik.enable=true"

# local
- "traefik.http.routers.aross-api.rule=Host(`localhost`) && PathPrefix(`/api/aross-stations`)"
# Production domains (blue, green, and nsidc.org)
- "traefik.http.routers.aross-api.rule=(Host(`blue.aross-stations.apps.int.nsidc.org`) || Host(`green.aross-stations.apps.int.nsidc.org`) || Host(`nsidc.org`)) && PathPrefix(`/api/aross-stations`)"
- "traefik.http.routers.aross-api.entrypoints=websecure"
- "traefik.http.routers.aross-api.tls=true"
- "traefik.http.routers.aross-api.tls.certresolver=letsencrypt"
Expand Down
Loading