-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.dev.yml
89 lines (86 loc) · 2.31 KB
/
docker-compose.dev.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
version: "3"
services:
prometheus:
image: quay.io/prometheus/prometheus:latest
ports:
- "9090:9090"
volumes:
- "./prometheus.yml:/var/lib/prometheus/prometheus.yml"
node-exporter:
image: prom/node-exporter
ports:
- "9100:9100"
grafana:
image: grafana/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
depends_on:
- prometheus
ports:
- "3100:3100"
app:
build: "."
restart: "always"
ports:
- ${APP_PORT:-3000}:3000
env_file:
- ".env"
depends_on:
- "db"
- "db_test"
volumes:
- ".:/go/src/github.com/oysterprotocol/brokernode"
- "./data/badger/prod:/var/lib/badger/prod"
- "./data/badger/test:/var/lib/badger/test"
working_dir: "/go/src/github.com/oysterprotocol/brokernode"
command: >
bash -c "
echo waiting for db...;
while ! nc -z db 3306;
do
sleep 0.5;
done;
echo waiting for db_test...;
while ! nc -z db_test 3306;
do
sleep 0.5;
done;
echo ${DEBUG}
if [ -z ${DEBUG} ]; then
echo \"Starting Buffalo PROD mode\";
buffalo db migrate;
buffalo build -o ./bin/brokernode && chmod +x ./bin/brokernode;
./bin/brokernode;
else
echo \"Starting Buffalo DEV mode\";
buffalo db migrate;
buffalo dev;
fi
"
db:
image: "mariadb:10.3"
restart: "always"
environment:
- MYSQL_DATABASE=brokernode
- MYSQL_ROOT_USER=root
- MYSQL_ROOT_PASSWORD=secret
# - MYSQL_DATABASE=${DB_NAME_DEV:-dev}
# - MYSQL_ROOT_USER=${DB_USER_DEV:-root}
# - MYSQL_ROOT_PASSWORD=${DB_USER_DEV:-secret}
volumes:
- "./data/mariadb/dev:/var/lib/mariadb"
- "./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d"
# TODO: Figure out a better way to handle multiple envs
db_test:
image: "mariadb:10.3"
restart: "always"
environment:
- MYSQL_DATABASE=brokernode_test
- MYSQL_ROOT_USER=root
- MYSQL_ROOT_PASSWORD=secret
# - MYSQL_DATABASE=${DB_NAME_TEST:-test}
# - MYSQL_ROOT_USER=${DB_USER_TEST:-root}
# - MYSQL_ROOT_PASSWORD=${DB_USER_TEST:-secret}
volumes:
- "./data/mariadb/test:/var/lib/mariadb"
- "./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d"