forked from scalableminds/webknossos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-ec2.yml
136 lines (126 loc) · 3.66 KB
/
docker-compose-ec2.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: "2.2"
services:
webknossos:
image: lincbrain/webknossos:ak_dev__107
ports:
- "127.0.0.1:9000:9000"
depends_on:
postgres:
condition: service_healthy
fossildb:
condition: service_healthy
redis:
condition: service_healthy
command:
- -Dconfig.file=conf/application.conf
- -Djava.net.preferIPv4Stack=true
- -Dtracingstore.fossildb.address=fossildb
- -Dtracingstore.redis.address=redis
- -Ddatastore.redis.address=redis
- -Dslick.db.url=jdbc:postgresql://postgres/webknossos
- -DwebKnossos.sampleOrganization.enabled=false
- -Dtracingstore.publicUri=https://${PUBLIC_HOST}
- -Ddatastore.publicUri=https://${PUBLIC_HOST}
volumes:
- ./binaryData:/webknossos/binaryData
environment:
- JAVA_OPTS=-Xmx48g -Xms24g
- PUBLIC_HOST=webknossos.lincbrain.org
- AWS_ACCESS_KEY=0+asdasd
- AWS_ACCESS_KEY_ID=asdasd
- POSTGRES_URL=jdbc:postgresql://postgres/webknossos
- VIRTUAL_HOST=${PUBLIC_HOST}
- LETSENCRYPT_HOST=${PUBLIC_HOST}
user: "root"
networks:
- webknossos_default
restart: always
# Postgres
postgres:
image: postgres:15-bullseye
environment:
POSTGRES_DB: webknossos
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -h 127.0.0.1 -p 5432"]
interval: 2s
timeout: 5s
retries: 30
ports:
- "127.0.0.1:5432:5432"
volumes:
- "./persistent/postgres:/var/lib/postgresql/data/"
psql:
extends: postgres
command: psql -h postgres -U postgres webknossos
depends_on:
postgres:
condition: service_healthy
environment:
PGPASSWORD: postgres
# FossilDB
fossildb:
image: scalableminds/fossildb:master__489
command:
- fossildb
- -c
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates,volumeSegmentIndex,editableMappings,editableMappingUpdates,editableMappingsInfo,editableMappingsAgglomerateToGraph,editableMappingsSegmentToAgglomerate
user: 0:0
volumes:
- "./persistent/fossildb/data:/fossildb/data"
- "./persistent/fossildb/backup:/fossildb/backup"
# Redis
redis:
image: redis:7
command:
- redis-server
healthcheck:
test:
- CMD
- bash
- -c
- "exec 3<> /dev/tcp/127.0.0.1/6379 && echo PING >&3 && head -1 <&3 | grep PONG"
timeout: 1s
interval: 5s
retries: 10
nginx-proxy:
image: nginx:latest
container_name: nginx-proxy
ports:
- "8080:8080"
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/letsencrypt
- /home/ec2-user/opt/webknossos/binaryData:/home/ec2-user/opt/webknossos/binaryData:ro
depends_on:
- webknossos
fossil-db-backup:
image: scalableminds/fossildb-client:master
depends_on:
fossildb:
condition: service_healthy
command: ["webknossos-fossildb-1", "backup"]
networks:
- webknossos_default
fossil-db-restore:
image: scalableminds/fossildb-client:master
depends_on:
fossildb:
condition: service_healthy
command: ["webknossos-fossildb-1", "restore"]
networks:
- webknossos_default
postgres-backup:
image: postgres
command: ["/bin/bash", "-c", "PGPASSWORD=postgres pg_dump -Fc -h postgres -U postgres webknossos | gzip > /backups/backup_$(date +%Y-%m-%d_%H-%M).sql.gz"]
volumes:
- ./backups:/backups
depends_on:
- postgres
# Explicitly declare networks for fossil-db-backup connectivity
networks:
webknossos_default:
external: true