One compose-file for docker-compose and docker stack deploy.

This commit is contained in:
Patrick Jentsch 2020-01-06 09:42:47 +01:00
parent 54b431c70c
commit 360ee0f450
3 changed files with 16 additions and 127 deletions

View File

@ -2,11 +2,12 @@ version: '3'
services:
web:
deploy:
placement:
constraints:
- node.role == manager
ports:
- "5000:5000"
depends_on:
- db
- redis
env_file: nopaque.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
volumes:
@ -20,8 +21,10 @@ services:
- ./nopaque.py:/home/nopaque/nopaque.py
- ./requirements.txt:/home/nopaque/requirements.txt
daemon:
depends_on:
- db
deploy:
placement:
constraints:
- node.role == manager
env_file: nopaque.env
extra_hosts:
- "host.docker.internal:172.17.0.1"
@ -35,9 +38,17 @@ services:
- ../opaque_daemon/requirements.txt:/home/nopaqued/requirements.txt
- $HOME/.docker:/home/nopaqued/.docker
db:
deploy:
placement:
constraints:
- node.role == manager
env_file: nopaque.env
image: postgres:11
volumes:
- /srv/nopaque/database:/var/lib/postgresql/data
redis:
deploy:
placement:
constraints:
- node.role == manager
image: redis:5

View File

@ -1,66 +0,0 @@
version: '3'
services:
traefik:
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.nopaque.address=:5000"
image: traefik:2.0
ports:
- 5000:5000
- 9090:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
web:
ports:
- "5000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.nopaque.entrypoints=nopaque"
- "traefik.http.routers.nopaque.rule=Host(`nopaque.localhost`)"
# Use sticky sessions for load balancing
# Socket.IO is not compatible with cookie sticky sessions which are the
# only available option in traefik
- "traefik.http.services.web-opaque.loadbalancer.sticky=true"
- "traefik.http.services.web-opaque.loadbalancer.sticky.cookie.httpOnly=true"
depends_on:
- db
- redis
env_file:
- db.env
- web.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
volumes:
- /mnt/nopaque:/mnt/nopaque
- ./app:/home/nopaque/app
- ./logs:/home/nopaque/logs
- ./migrations:/home/nopaque/migrations
- ./tests:/home/nopaque/tests
- ./config.py:/home/nopaque/config.py
- ./docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
- ./nopaque.py:/home/nopaque/nopaque.py
- ./requirements.txt:/home/nopaque/requirements.txt
daemon:
depends_on:
- db
env_file:
- db.env
- web.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
volumes:
- /mnt/nopaque:/mnt/nopaque
- ./logs:/home/nopaqued/logs
- ../opaque_daemon/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
- ../opaque_daemon/nopaqued.py:/home/nopaqued/nopaqued.py
- ../opaque_daemon/merge_corpus_files.py:/home/nopaqued/merge_corpus_files.py
- ../opaque_daemon/requirements.txt:/home/nopaqued/requirements.txt
- $HOME/.docker:/home/nopaqued/.docker
db:
env_file: db.env
image: postgres:11
volumes:
- /srv/nopaque/database:/var/lib/postgresql/data
redis:
image: redis:5

View File

@ -1,56 +0,0 @@
version: '3'
services:
web:
deploy:
placement:
constraints:
- node.role == manager
env_file:
- db.env
- web.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
ports:
- 5000:5000
volumes:
- /mnt/nopaque:/mnt/nopaque
- ./app:/home/nopaque/app
- ./logs:/home/nopaque/logs
- ./migrations:/home/nopaque/migrations
- ./tests:/home/nopaque/tests
- ./config.py:/home/nopaque/config.py
- ./docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
- ./nopaque.py:/home/nopaque/nopaque.py
- ./requirements.txt:/home/nopaque/requirements.txt
daemon:
deploy:
placement:
constraints:
- node.role == manager
env_file:
- db.env
- web.env
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
volumes:
- /mnt/nopaque:/mnt/nopaque
- ./logs:/home/nopaqued/logs
- ../opaque_daemon/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
- ../opaque_daemon/nopaqued.py:/home/nopaqued/nopaqued.py
- ../opaque_daemon/merge_corpus_files.py:/home/nopaqued/merge_corpus_files.py
- ../opaque_daemon/requirements.txt:/home/nopaqued/requirements.txt
- $HOME/.docker/config.json:/home/nopaqued/.docker/config.json
db:
deploy:
placement:
constraints:
- node.role == manager
env_file: db.env
image: postgres:11
volumes:
- /srv/nopaque/database:/var/lib/postgresql/data
redis:
deploy:
placement:
constraints:
- node.role == manager
image: redis:5