-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
87 lines (81 loc) · 3.15 KB
/
docker-compose.yaml
File metadata and controls
87 lines (81 loc) · 3.15 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: ns-assembly # define the name of the app
services: # define services
app: # main Python app
build: ./ # build using a Dockerfile in the local directory
depends_on: # delay startup until the DB is ready to accept connections
db:
condition: service_healthy
akari:
condition: service_started
restart: always # if errors occur, restart
secrets: # pass secrets to the container
- bot-token
- app-db-password
environment: # pass location of secrets to the container
ASSEMBLY_TOKEN_FILE: /run/secrets/bot-token
NS_USER_AGENT: idinist_imauggland
POSTGRES_PASSWORD_FILE: /run/secrets/app-db-password
POSTGRES_USER: ns_assembly_app
POSTGRES_HOST: ns_assembly_db
POSTGRES_PORT: 5432
POSTGRES_ASSEMBLY_DB: ns_assembly
POSTGRES_AKARI_DB: ns_akari
networks: # allow the two containers to communicate
- app-local
akari: # akari SSE client
build: https://github.com/Merethin/Akari.git # build using the latest image from the GitHub repo
depends_on: # delay startup until the DB is ready to accept connections
db:
condition: service_healthy
restart: always # if errors occur, restart
secrets: # pass secrets to the container
- akari-db-password
environment: # pass connection info to the container
NS_USER_AGENT: idinist_imauggland
DATABASE_HOST: ns_assembly_db
DATABASE_PORT: 5432
DATABASE_USER: ns_akari
DATABASE_NAME: ns_akari
DATABASE_PASSWORD_FILE: /run/secrets/akari-db-password
networks: # allow the containers to communicate
- akari-local
volumes: # bind the config directory into the container
- ./conf/akari:/config
db: # postgres DB
hostname: ns_assembly_db # assign a hostname for easier connection
image: postgres:18.4-alpine3.23 # use the latest Postgres Alpine image
shm_size: 128mb # define a memory limit
restart: always # restart if errors occur
environment: # pass location of secrets to the container, and define non-secret configuration info
POSTGRES_PASSWORD_FILE: /run/secrets/sudo-db-password
APP_PASSWORD_FILE: /run/secrets/app-db-password
AKARI_PASSWORD_FILE: /run/secrets/akari-db-password
secrets: # pass secrets to the container
- app-db-password
- akari-db-password
- sudo-db-password
volumes: # map a volume to the Postgres data directory
- db-data:/var/lib/postgresql # data
- ./sql/init:/docker-entrypoint-initdb.d # initialization scripts
networks: # allow the two containers to communicate
- app-local
- akari-local
healthcheck: # set up a health check to confirm when the DB is ready
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
secrets: # define secrets
bot-token:
file: ./conf/secrets/token.conf
app-db-password:
file: ./conf/secrets/appdb.conf
akari-db-password:
file: ./conf/secrets/akaridb.conf
sudo-db-password:
file: ./conf/secrets/sudodb.conf
volumes: # allow Docker to handle volume storage
db-data:
networks: # allow Docker to handle networking
app-local:
akari-local: