-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (126 loc) · 3.61 KB
/
docker-compose.yml
File metadata and controls
141 lines (126 loc) · 3.61 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
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
137
138
139
140
141
name: ${COMPOSE_PROJECT_NAME:-cht-sync}
x-dbt-base: &dbt-common
build: ./dbt/
working_dir: /dbt/
environment: &dbt-env
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_TABLE: ${POSTGRES_TABLE}
POSTGRES_SCHEMA: ${POSTGRES_SCHEMA}
ROOT_POSTGRES_SCHEMA: ${POSTGRES_SCHEMA}
DATAEMON_INTERVAL: ${DATAEMON_INTERVAL}
DBT_THREAD_COUNT: ${DBT_THREAD_COUNT:-1}
DBT_BATCH_SIZE: ${DBT_BATCH_SIZE:-0}
services:
couch2pg:
build: ./couch2pg/
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "512m"
environment:
<<: *dbt-env
COUCHDB_USER: ${COUCHDB_USER}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
COUCHDB_HOST: ${COUCHDB_HOST}
COUCHDB_DBS: ${COUCHDB_DBS}
COUCHDB_PORT: ${COUCHDB_PORT}
COUCHDB_SECURE: ${COUCHDB_SECURE:-true}
restart: always
#### Test ##############################################################################################
dbt-test-contacts:
<<: *dbt-common
volumes:
- "${DBT_LOCAL_PATH}:/dbt/package/"
profiles:
- test
environment:
<<: *dbt-env
DBT_SELECTOR: tag:contacts
DBT_LOCAL_PATH: ${DBT_LOCAL_PATH}
dbt-test-reports:
<<: *dbt-common
volumes:
- "${DBT_LOCAL_PATH}:/dbt/package/"
profiles:
- test
depends_on:
- dbt-test-contacts
environment:
<<: *dbt-env
DBT_SELECTOR: tag:reports
DBT_LOCAL_PATH: ${DBT_LOCAL_PATH}
couchdb:
image: public.ecr.aws/medic/cht-couchdb:4.15.0
restart: always
profiles:
- test
ports:
- "5984:5984"
environment:
- COUCHDB_USER=${COUCHDB_USER}
- COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
- COUCHDB_SECRET=9c0d6034-0f19-45df-8fcd-5fec9c473c73
- COUCHDB_UUID=4c6bffc8-a5ac-4f98-a34c-6fb0e63964e5
#### Local ##############################################################################################
postgres:
image: postgres:16
restart: always
profiles:
- test
- local
volumes:
- ./postgres/init-dbt-resources.sh:/docker-entrypoint-initdb.d/init-dbt-resources.sh:z
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_TABLES=${COUCHDB_DBS}
- POSTGRES_SCHEMA=${POSTGRES_SCHEMA}
dbt-local:
<<: *dbt-common
volumes:
- "${DBT_LOCAL_PATH}:/dbt/package/"
profiles:
- local
environment:
<<: *dbt-env
DBT_SELECTOR: ''
DBT_LOCAL_PATH: ${DBT_LOCAL_PATH}
pgadmin:
image: dpage/pgadmin4
profiles:
- local
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:
- "${PGADMIN_PORT:-5050}:80"
#### Production ##########################################################################################
dbt-production:
<<: *dbt-common
profiles:
- production
environment:
<<: *dbt-env
DBT_SELECTOR: ''
CHT_PIPELINE_BRANCH_URL: ${CHT_PIPELINE_BRANCH_URL}
bastion:
build: ./bastion/
restart: unless-stopped
profiles:
- production
- test
ports:
- ${BASTION_PORT:-22222}:22/tcp
volumes:
- ${BASTION_AUTHORIZED_KEYS_FILE:-$PWD/bastion/authorized_keys}:/var/lib/bastion/authorized_keys-tmp
- bastion:/usr/etc/ssh:rw
volumes:
bastion: