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

example docker-compose.yml #197

Open
wants to merge 14 commits into
base: master
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
142 changes: 142 additions & 0 deletions templates/docker-compose.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#docker-compose.template.yml
version: '3.7'
services:
template-postgis:
environment:
- SECRET=admin
- DOCKER_ENV=DEVELOPMENT
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=template
- POSTGRES_USER=postgres
- POSTGIS_HOST=postgresql
- CONTAINER=template-postgis
- DOCKER_USER=template
container_name: template-postgis
image: docker.merkator.com/template/postgis:latest
volumes:
- type: volume
source: template-postgis
target: /var/lib/postgresql/data
- type: bind
source: d:\github\docker4gis\binds\secrets
target: /secrets
- type: bind
source: d:\github\docker4gis\binds\fileport
target: /fileport
- type: bind
source: d:\github\docker4gis\binds\certificates
target: /certificates
- type: bind
source: d:\github\docker4gis\binds\runner
target: /util/runner/log
ports:
- "5432:5432"
networks:
- default
- template-net
template-geoserver:
environment:
- GEOSERVER_HOST=geoserver.merkator.com
- GEOSERVER_USER=admin
- GEOSERVER_PASSWORD=geoserver
- DOCKER_USER=template
container_name: template-geoserver
image: docker.merkator.com/template/geoserver:latest
volumes:
- type: volume
source: template-geoserver
target: /geoserver/data/workspaces
- type: bind
source: d:\github\docker4gis\binds\secrets
target: /secrets
- type: bind
source: d:\github\docker4gis\binds\fileport
target: /fileport
- type: bind
source: d:\github\docker4gis\binds\certificates
target: /certificates
- type: bind
source: d:\github\docker4gis\binds\gwc
target: /geoserver/cache
- type: bind
source: d:\github\docker4gis\binds\runner
target: /util/runner/log
ports:
- "58080:8080"
networks:
- default
- template-net
depends_on:
- template-postgis
template-api:
environment:
- DOCKER_ENV=DEVELOPMENT
# - POSTGIS_HOST=template-postgis
# - POSTGIS_PORT=5432
- DOCKER_USER=template
container_name: template-api
image: docker.merkator.com/template/api:latest
volumes:
- type: volume
source: template-api
target: /host
- type: bind
source: d:\github\docker4gis\binds\runner
target: /util/runner/log
- type: bind
source: d:\github\docker4gis\binds\secrets
target: /secrets
- type: bind
source: d:\github\docker4gis\binds\fileport
target: /fileport
ports:
- "9090:8080"
networks:
- default
- template-net
template-app:
container_name: template-app
image: docker.merkator.com/template/app:latest
networks:
- template-net
template-proxy:
environment:
- PROXY_HOST=localhost.merkator.com
- PROXY_PORT=7443
- API=http://template-api:8080/
- APP=http://template-app/
- GEOSERVER=http://template-geoserver:8080/geoserver/
- HOMEDEST=/template/app
- DOCKER_USER=template
container_name: template-proxy
image: docker.merkator.com/template/proxy:latest
volumes:
- type: bind
source: d:\github\docker4gis\binds\certificates
target: /certificates
- type: volume
source: template-proxy
target: /config
networks:
- default
- template-net
depends_on:
- template-postgis
- template-geoserver
- template-api
- template-app
ports:
- "7443:443"
- "82:80"
extra_hosts:
- "localhost.merkator.com:127.0.0.1"

volumes:
template-postgis: {}
template-geoserver: {}
template-api: {}
template-proxy: {}

networks:
template-net:
internal: true
3 changes: 3 additions & 0 deletions templates/proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ ENV HOMEDEST="/${DOCKER_USER}/app/"

# Where to ask for authorisation
ENV AUTH_PATH="http://${DOCKER_USER}-api:8080/rpc/auth_path"

# IF you don't want all the containers availible throught the proxy make your own config to limit to only the ones you want and add that config
# COPY conf/conf.sh /conf.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

together with templates/proxy/conf/conf.sh

55 changes: 55 additions & 0 deletions templates/proxy/conf/conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Dockerfile copy this file into the container and overrule the base version


DOCKER_USER="${DOCKER_USER}"
SECRET="${SECRET}"
HOMEDEST="${HOMEDEST}"
API="${API}"
APP="${APP}"

## all
# RESOURCES="http://${DOCKER_USER}-resources"
# GEOSERVER="http://${DOCKER_USER}-geoserver:8080/geoserver/"
# MAPFISH="http://${DOCKER_USER}-mapfish:8080"
# MAPSERVER="http://${DOCKER_USER}-mapserver"
# MAPPROXY="http://${DOCKER_USER}-mapproxy"
# SWAGGER="http://${DOCKER_USER}-swagger:8080"

echo DOCKER_USER="${DOCKER_USER}"

##all
# echo "secret=${SECRET}
# homedest=${HOMEDEST}
# api=${API}
# app=${APP}
# static=${APP}static/
# favicon.ico=${APP}favicon.ico
# manifest.json=${APP}manifest.json
# service-worker.js=${APP}service-worker.js
# index.html=${APP}index.html
# index=${APP}index
# html=${APP}html/
# geoserver=${GEOSERVER}
# mapfish=${MAPFISH}
# resources=${RESOURCES}
# mapserver=${MAPSERVER}
# mapproxy=${MAPPROXY}
# swagger=${SWAGGER}
# swagger-ui.css.map=${SWAGGER}/swagger-ui.css.map
# swagger-ui-bundle.js.map=${SWAGGER}/swagger-ui-bundle.js.map
# swagger-ui-standalone-preset.js.map=${SWAGGER}/swagger-ui-standalone-preset.js.map
# " > "/config/${DOCKER_USER}"

## Limited
## make sure this file is added in the Docker file, otherwise the default conf.sh from base will be run
echo "api=${API}
app=${APP}
favicon.ico=${APP}favicon.ico
index.html=${APP}index.html
index=${APP}index
html=${APP}html/
" > "/config/${DOCKER_USER}"

for proxy in ${@}
do
echo "${proxy}" >> "/config/${DOCKER_USER}"
done