Skip to content

Commit

Permalink
Added second pygeoapi service to docker-compose.yml that adheres to D…
Browse files Browse the repository at this point in the history
…utch ADR [#52]
  • Loading branch information
GeoSander committed Mar 16, 2023
1 parent d1c4668 commit 73fb7dd
Show file tree
Hide file tree
Showing 4 changed files with 981 additions and 5 deletions.
38 changes: 38 additions & 0 deletions services/pygeoapi/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,44 @@ services:
- "traefik.http.routers.${SERVICE_NAME}_http.rule=Host(`localhost`) && PathPrefix(`${SERVICE_PATH}`)"
- "traefik.http.routers.${SERVICE_NAME}_http.entrypoints=http"

adr_pygeoapi:

image: ${DOCKER_IMAGE}

container_name: ${SERVICE_NAME_ADR}

expose:
- "80"

# ports:
# - "5000:80"

environment:
# Specific to Flask apps
- SCRIPT_NAME=${SERVICE_PATH_ADR}

volumes:
# Map data and config into pygeoapi container
- ./local.config.yml:/pygeoapi/local.config.adr.yml
- ./data:/pygeoapi/data

labels:
# Enable Traefik routing on overlay service network
- "traefik.enable=true"
- "traefik.docker.network=service-network"

# Define SSL/https router
- "traefik.http.routers.${SERVICE_NAME}_https.rule=Host(`${TRAEFIK_SSL_DOMAIN}`) && PathPrefix(`${SERVICE_PATH_ADR}`)"
- "traefik.http.routers.${SERVICE_NAME}_https.entrypoints=https"
- "traefik.http.routers.${SERVICE_NAME}_https.tls=${TRAEFIK_USE_TLS}"
- "traefik.http.routers.${SERVICE_NAME}_https.tls.certresolver=${TRAEFIK_SSL_CERT_RESOLVER}"
- "traefik.http.routers.${SERVICE_NAME}_https.tls.options=my_default@file"
- "traefik.http.routers.${SERVICE_NAME}_https.middlewares=secure-headers@file"

# Define local http router
- "traefik.http.routers.${SERVICE_NAME}_http.rule=Host(`localhost`) && PathPrefix(`${SERVICE_PATH_ADR}`)"
- "traefik.http.routers.${SERVICE_NAME}_http.entrypoints=http"

networks:
default:
external:
Expand Down
2 changes: 2 additions & 0 deletions services/pygeoapi/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ source ../env.sh

# Change for new service and subpath
export SERVICE_NAME="pygeoapi"
export SERVICE_NAME_ADR="adr_pygeoapi"

# Is subpath (becomes SCRIPT_NAME for Python web apps only).
export SERVICE_PATH="/${SERVICE_NAME}"
export SERVICE_PATH_ADR="/${SERVICE_NAME_ADR}"

# Can be usually left as is, unless you want to run specific build and/or version.
export DOCKER_IMAGE_NAME="geopython/pygeoapi"
Expand Down
Loading

0 comments on commit 73fb7dd

Please sign in to comment.