-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
73 lines (69 loc) · 1.76 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
73 lines (69 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: "3.9"
services:
api:
image: qgeissmann/insect-scanner-api:latest # or :latest
container_name: insect-scanner
environment:
- SCANNER_OUTPUT_DIR=/data
- PG_DSN=postgresql://postgres:postgres@db:5432/postgres?connect_timeout=5
env_file:
- .env
ports: ["8000:8000"]
volumes:
- ${SCANNER_HOST_OUTPUT_DIR}:/data
- /run/udev:/run/udev:ro
- /etc/machine-id:/etc/host_machine_id:ro
devices:
- /dev/bus/usb:/dev/bus/usb
user: "0:0"
privileged: true
restart: unless-stopped
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8000/healthz || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
# Optional: always pull newest tag at 'up'
pull_policy: always
webapp-shiny:
image: qgeissmann/insect-scanner-webapp:latest # or :latest
container_name: insect-scanner-webapp
environment:
- API_BASE=http://api:8000
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASS=postgres
- PUBLIC_API_BASE=http://localhost:8000
- LABEL_MAKER_URL=${LABEL_MAKER_URL}
ports: ["8080:8080"]
depends_on:
api:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
networks:
default:
aliases:
- postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 2s
timeout: 2s
retries: 30
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
volumes:
pgdata: