Add reverse proxy

This commit is contained in:
Patrick Jentsch 2020-01-09 15:13:47 +01:00
parent 44054a51c3
commit 0a388fe4b2
3 changed files with 16 additions and 26 deletions

View File

@ -1,18 +1,18 @@
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
nginx-proxy:
depends_on:
- web
deploy:
placement:
constraints:
- node.role == manager
ports:
- "80:80"
image: jwilder/nginx-proxy:latest
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
web:
depends_on:
- db
@ -21,18 +21,9 @@ services:
placement:
constraints:
- node.role == manager
environment:
- VIRTUAL_HOST=nopaque.localhost
env_file: nopaque.env
# 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"
ports:
- "5000:5000"
image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development
volumes:
- /mnt/nopaque:/mnt/nopaque

View File

@ -6,9 +6,8 @@ echo "Waiting for redis..."
wait-for-it redis:6379 --strict --timeout=0
if [ $# -eq 0 ]; then
venv/bin/python -u nopaque.py
venv/bin/python nopaque.py
elif [ $1 == "flask" ]; then
echo "$@"
venv/bin/python -m $@
else
echo "Unknown command"

View File

@ -1,4 +1,4 @@
### Database ###
### PostgreSQL ###
POSTGRES_DB_NAME=
POSTGRES_USER=
POSTGRES_PASSWORD=