diff --git a/README.md b/README.md index b887454..195f562 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/compose.dev.yml b/compose.dev.yml index 37c55b0..0cf0e13 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -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"] @@ -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 diff --git a/compose.integration.yml b/compose.integration.yml index 6cb0b0f..133eb88 100644 --- a/compose.integration.yml +++ b/compose.integration.yml @@ -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" diff --git a/compose.qa.yml b/compose.qa.yml index 92f2e1f..50aeb81 100644 --- a/compose.qa.yml +++ b/compose.qa.yml @@ -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" diff --git a/compose.staging.yml b/compose.staging.yml index b1337cd..7769964 100644 --- a/compose.staging.yml +++ b/compose.staging.yml @@ -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" diff --git a/compose.yml b/compose.yml index 21cdd90..bddadd3 100644 --- a/compose.yml +++ b/compose.yml @@ -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" @@ -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"] @@ -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"