diff --git a/dashboard/start.sh b/dashboard/start.sh new file mode 100755 index 0000000..5b0cf38 --- /dev/null +++ b/dashboard/start.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Tunnel SSH vers Vigile (DB) +cp /ssh/vigile.key /tmp/vigile.key +chmod 600 /tmp/vigile.key +ssh -fN -L 15432:localhost:5432 -i /tmp/vigile.key -o StrictHostKeyChecking=no -o ServerAliveInterval=30 ubuntu@79.72.30.231 + +echo '[start.sh] Tunnel SSH vers Vigile établi sur 127.0.0.1:15432' + +exec python app.py diff --git a/docker-compose.yml b/docker-compose.yml index 38fb05a..c58877d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,13 +6,11 @@ services: working_dir: /app volumes: - ./dashboard/app.py:/app/app.py:ro + - ./dashboard/start.sh:/app/start.sh:ro - /home/ubuntu/.ssh/vigile_backup:/ssh/vigile.key:ro - ./src/config:/app/src/config - ./tools:/app/tools:ro - command: > - sh -c "apk add --no-cache openssh-client && - pip install flask psycopg2-binary --quiet && - python app.py" + command: sh -c 'apk add --no-cache openssh-client && pip install flask psycopg2-binary --quiet && sh /app/start.sh' networks: - proxy-nw extra_hosts: