-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.demo.yml
148 lines (140 loc) · 3.71 KB
/
docker-compose.demo.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
137
138
139
140
141
142
143
144
145
146
147
148
name: metad-ocap-demo
volumes:
postgres_data:
certificates:
networks:
overlay:
driver: bridge
services:
db:
container_name: db
image: postgres:12-alpine
restart: always
environment:
POSTGRES_DB: ${DB_NAME:-postgres}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASS:-root}
healthcheck:
test:
[
'CMD-SHELL',
'psql postgres://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@localhost:5432/$${POSTGRES_DB} || exit 1'
]
volumes:
- postgres_data:/var/lib/postgresql/data
- ./.scripts/initdb.d/:/docker-entrypoint-initdb.d/:ro
networks:
- overlay
adminer:
container_name: adminer
image: adminer
restart: always
depends_on:
- db
links:
- db:${DB_HOST:-db}
environment:
ADMINER_DEFAULT_DB_DRIVER: pgsql
ADMINER_DEFAULT_DB_HOST: ${DB_HOST:-db}
ADMINER_DEFAULT_DB_NAME: ${DB_NAME:-postgres}
ADMINER_DEFAULT_DB_PASSWORD: ${DB_PASS:-root}
ports:
- '8084:8080'
networks:
- overlay
redis:
container_name: redis
image: redis:6-alpine
mem_limit: 100m
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'redis-cli -h localhost -p 6379 PING']
interval: 1s
timeout: 30s
command: ['sh', '-c', 'redis-server --requirepass $${REDIS_PASSWORD}']
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
volumes:
- ./.deploy/redis/data:/data
networks:
- overlay
# OLAP Services
olap:
image: metadc/metad-olap:1.0.0
deploy:
replicas: 1
restart: unless-stopped
healthcheck:
test: curl -m 5 --silent --fail --request GET http://localhost:8080/ | jq --exit-status -n 'inputs | if has("status") then .status=="UP" else false end' > /dev/null || exit 1
interval: 10s
timeout: 2s
retries: 10
environment:
OLAP_REDIS_DATABASE: 1
OLAP_REDIS_HOST: 'redis'
OLAP_REDIS_PORT: 6379
OLAP_REDIS_PASSWORD: ${REDIS_PASSWORD:-}
networks:
- overlay
api:
container_name: api
image: ghcr.io/meta-d/ocap-api-demo:latest
environment:
HOST: ${API_HOST:-api}
PORT: ${API_PORT:-3000}
NODE_ENV: ${NODE_ENV:-development}
DB_HOST: db
REDIS_HOST: redis
REDIS_PORT: 6379
OLAP_HOST: olap
OLAP_PORT: 8080
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
SENTRY_DSN: ${SENTRY_DSN:-}
env_file:
- .env
command: ['node', 'main.js']
restart: on-failure
depends_on:
- db
- redis
links:
- db:${DB_HOST:-db}
ports:
- '3000:${API_PORT:-3000}'
volumes:
- ./.volumes/api/public:/srv/pangolin/public
networks:
- overlay
webapp:
container_name: webapp
image: ghcr.io/meta-d/ocap-webapp-demo:latest
environment:
# PORT: 80
NODE_ENV: ${NODE_ENV:-development}
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
CLIENT_BASE_URL: ${CLIENT_BASE_URL:-http://localhost:4200}
SENTRY_DSN: ${SENTRY_DSN:-}
DEFAULT_LATITUDE: ${DEFAULT_LATITUDE:-42.6459136}
DEFAULT_LONGITUDE: ${DEFAULT_LONGITUDE:-23.3332736}
DEFAULT_CURRENCY: ${DEFAULT_CURRENCY:-USD}
API_HOST: ${API_HOST:-api}
API_PORT: ${API_PORT:-3000}
entrypoint: './entrypoint.compose.sh'
command: ['nginx', '-g', 'daemon off;']
# command: ['nginx', '-g', 'daemon off;', '-c', '/webapp/conf/nginx.conf']
env_file:
- .env
restart: on-failure
links:
- db:${DB_HOST:-db}
- api:${API_HOST:-api}
depends_on:
- db
- api
ports:
- ${WEB_PORT:-80}:80
# - ${WEB_PORT:-443}:443
# volumes:
# - ./.volumes/webapp/:/webapp/
networks:
- overlay