-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
139 lines (139 loc) · 3.79 KB
/
docker-compose.yaml
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
services:
frontend:
build:
context: .
dockerfile: ./solardoc/frontend/Dockerfile
args:
PUPPETEER_SKIP_DOWNLOAD: "true"
volumes:
- ./solardoc/frontend:/home/node/app
- ./solardoc/frontend/nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf
ports:
- "80:80"
environment:
PUPPETEER_SKIP_DOWNLOAD: true
PROD_BACKEND_PORT: ${BACKEND_PORT}
PROD_BACKEND_HOST: ${BACKEND_HOST}
PROD_PHOENIX_HOST: ${PHOENIX_HOST}
PROD_PHOENIX_PORT: ${PHOENIX_PORT}
API_BASE_PATH: ${API_BASE_PATH}
PHX_BASE_PATH: ${PHX_BASE_PATH}
PHX_WS_PATH: ${PHX_WS_PATH}
NODE_ENV: production
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost/" ]
interval: 10s
timeout: 10s
retries: 3
depends_on:
- rest-api
- phoenix-server
links:
- rest-api
restart: always
rest-api:
build:
context: .
dockerfile: ./solardoc/rest-api/Dockerfile
args:
PUPPETEER_SKIP_DOWNLOAD: "true"
PERSISTENT_STORAGE_PATH: ${PERSISTENT_STORAGE_PATH}
ports:
- "3000:3000"
environment:
STAGING: ${STAGING}
API_BASE_PATH: ${API_BASE_PATH}
REDIS_ROOT_PASSWORD: ${REDIS_ROOT_PASSWORD}
REDIS_USERNAME: ${REDIS_USERNAME}
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_HOST: redis-db
REDIS_PORT: 6379
PERSISTENT_STORAGE_PATH: ${PERSISTENT_STORAGE_PATH}
PUPPETEER_SKIP_DOWNLOAD: "true"
NODE_ENV: production
healthcheck:
test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/3000; exit $?;'"
interval: 10s
timeout: 10s
retries: 3
volumes:
- rest-api-persistent-storage:${PERSISTENT_STORAGE_PATH}
depends_on:
redis-db:
condition: service_healthy
links:
- redis-db
restart: always
phoenix-server:
build: solardoc/phoenix-server
ports:
- "4000:4000"
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql-db:5432/${POSTGRES_DB}
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
PORT: 4000
healthcheck:
test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/4000; exit $?;'"
interval: 10s
timeout: 10s
retries: 3
depends_on:
postgresql-db:
condition: service_healthy
links:
- postgresql-db
- rest-api
- redis-db
restart: always
redis-db:
build: ./solardoc/redis-db
ports:
- "6379:6379"
- "8001:8001"
privileged: true
volumes:
- ./solardoc/redis-db/data:/redis/data
environment:
REDIS_ROOT_PASSWORD: ${REDIS_ROOT_PASSWORD}
REDIS_USERNAME: ${REDIS_USERNAME}
REDIS_PASSWORD: ${REDIS_PASSWORD}
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 1s
timeout: 3s
retries: 30
restart: always
postgresql-db:
build: ./solardoc/postgresql-db
ports:
- "5432:5432"
user: "${UID}:${GID}"
environment:
PGUSER: ${POSTGRES_USER}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./solardoc/postgresql-db/scripts:/docker-entrypoint-initdb.d/
- ./solardoc/postgresql-db/postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"]
interval: 1s
timeout: 5s
retries: 10
restart: always
postgres-adminer:
build: ./solardoc/postgres-adminer
ports:
- "8081:8080"
healthcheck:
test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/8080; exit $?;'"
interval: 10s
timeout: 10s
retries: 3
environment:
ADMINER_DESIGN: 'hydra'
restart: always
volumes:
frontend:
rest-api-persistent-storage: