-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (104 loc) · 2.69 KB
/
docker-compose.yml
File metadata and controls
115 lines (104 loc) · 2.69 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
volumes:
influx-data:
# YAML Anchors
x-deployment-env:
&deployment-env
ENV: ${ENV:-development}
SG_ENV: ${SG_ENV:-development}
x-influxdb-api-key: &influxdb-api-key .env.influxdb
x-influxdb-client-env:
&influxdb-client-env
INFLUX_BUCKET: ${INFLUX_BUCKET:-place}
INFLUX_HOST: ${INFLUX_HOST:-http://influxdb:8086}
INFLUX_ORG: ${INFLUX_ORG:-PlaceOS}
x-mqtt-client-env:
&mqtt-client-env
MQTT_HOST: ${MQTT_HOST:-mqtt}
MQTT_PORT: ${MQTT_PORT:-1883}
x-redis-client-env:
&redis-client-env
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
x-postgresdb-client-env:
&postgresdb-client-env
PG_HOST: ${PG_HOST:-postgres}
PG_PORT: ${PG_PORT:-5432}
PG_DB: ${PG_DB:-place_development}
PG_USER: ${PG_USER:-postgres}
PG_PASSWORD: ${PG_PASSWORD:-password}
services:
test:
image: placeos/service-spec-runner:${CRYSTAL_VERSION:-latest}
volumes:
- ${PWD}/coverage:/app/coverage
- ${PWD}/shard.lock:/app/shard.lock
- ${PWD}/shard.yml:/app/shard.yml.input
- ${PWD}/lib:/app/lib
- ${PWD}/spec:/app/spec
- ${PWD}/src:/app/src
depends_on:
- mqtt
- redis
- migrator
- postgres
- influxdb
security_opt:
- seccomp:unconfined
env_file:
- *influxdb-api-key
environment:
# Environment
GITHUB_ACTION: ${GITHUB_ACTION:-}
# Service Hosts
<<:
[
*influxdb-client-env,
*mqtt-client-env,
*redis-client-env,
*postgresdb-client-env,
*deployment-env
]
influxdb:
image: influxdb:${INFLUXDB_IMAGE_TAG:-2.0-alpine}
restart: always
hostname: influx
healthcheck:
test: influx bucket list
volumes:
- type: volume
source: influx-data
target: /root/.influxdbv2
command: "--reporting-disabled"
mqtt:
image: iegomez/mosquitto-go-auth:${MOSQUITTO_IMAGE_TAG:-latest}
hostname: mqtt
restart: always
volumes:
- ${PWD}/config/mosquitto.conf:/etc/mosquitto/mosquitto.conf
redis:
image: eqalpha/keydb
restart: always
hostname: redis
postgres:
hostname: postgres
image: postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 30s
timeout: 30s
retries: 3
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: place_development
ports:
- 5432:5432
migrator:
build:
context: ${PWD}/spec/migration
container_name: migrator
depends_on:
postgres:
condition: service_healthy
environment:
GITHUB_ACTION: ${GITHUB_ACTION:-}
PG_DATABASE_URL: ${PG_DATABASE_URL:-postgresql://postgres:password@postgres:5432/place_development}