ssh_scan_api/docker-compose.yml

56 строки
1.3 KiB
YAML

version: '2'
services:
base:
build:
context: .
dockerfile: ./docker/base
database:
build:
context: .
dockerfile: ./docker/database
# Uncomment below if you would like direct access to the DB for debugging/troubleshooting, this is not enabled by default for safety reasons
# ports:
# - 5432:5432
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- default
restart: unless-stopped
api:
build:
context: .
dockerfile: ./docker/api
tty: true
stdin_open: true
ports:
- 8000:8000
environment:
- sshscan.api.bind=api
- sshscan.database.host=database
- sshscan.worker.token=EXAMPLE_TOKEN_CHANGE_ME
links:
- database
networks:
- default
restart: always
depends_on:
- "base"
- "database"
command: ["/app/docker/wait-for-it.sh", "database:5432", "--", "/app/bin/ssh_scan_api"]
worker:
build:
context: .
dockerfile: ./docker/worker
environment:
- sshscan.api.host=api
- sshscan.worker.token=EXAMPLE_TOKEN_CHANGE_ME
command: /app/bin/ssh_scan_worker
links:
- api
networks:
- default
depends_on:
- "base"
- "api"
restart: always
command: ["/app/docker/wait-for-it.sh", "api:8000", "--", "/app/bin/ssh_scan_worker"]