fix: add SSH tunnel startup script, docker-compose uses start.sh

This commit is contained in:
Corback
2026-06-16 10:59:30 +00:00
parent 3330931f30
commit 20df05ff72
2 changed files with 13 additions and 4 deletions
+11
View File
@@ -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
+2 -4
View File
@@ -6,13 +6,11 @@ services:
working_dir: /app working_dir: /app
volumes: volumes:
- ./dashboard/app.py:/app/app.py:ro - ./dashboard/app.py:/app/app.py:ro
- ./dashboard/start.sh:/app/start.sh:ro
- /home/ubuntu/.ssh/vigile_backup:/ssh/vigile.key:ro - /home/ubuntu/.ssh/vigile_backup:/ssh/vigile.key:ro
- ./src/config:/app/src/config - ./src/config:/app/src/config
- ./tools:/app/tools:ro - ./tools:/app/tools:ro
command: > command: sh -c 'apk add --no-cache openssh-client && pip install flask psycopg2-binary --quiet && sh /app/start.sh'
sh -c "apk add --no-cache openssh-client &&
pip install flask psycopg2-binary --quiet &&
python app.py"
networks: networks:
- proxy-nw - proxy-nw
extra_hosts: extra_hosts: