-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
162 lines (154 loc) · 4.2 KB
/
docker-compose.yaml
File metadata and controls
162 lines (154 loc) · 4.2 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
services:
frontend:
build: frontend
init: true
ports:
- "3000:3000"
environment:
# Reason for override:
# * Requests from server cannot access host "localhost"
# * Requests from user agent cannot access host "server"
API_URL_SERVER_OVERRIDE: http://server:8080/api
server:
build:
context: backend
dockerfile: server.dockerfile
init: true
ports:
- "8080:8080"
- "40000:40000" # debugger port
depends_on:
database-migrate:
condition: service_completed_successfully
database-influx:
condition: service_healthy
env_file:
- .env
environment:
SERVER_URL: localhost:8080
PORT: 8080
MAIN_DOMAIN: "" # must be empty for localhost
FRONTEND_URL: http://localhost:3000
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_OPTS: sslmode=disable # sslmode=require for prod
INFLUXDB_URL: ${INFLUXDB_URL}
INFLUXDB_TOKEN: ${INFLUXDB_TOKEN}
INFLUXDB_ORG: ${INFLUXDB_ORG}
INFLUXDB_BUCKET: ${INFLUXDB_BUCKET}
REDIS_ADDRESS: ${REDIS_ADDRESS}
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_USE_TLS: false
gh-updater:
build:
context: backend
dockerfile: gh-updater.dockerfile
init: true
ports:
- "40001:40000" # debugger port
depends_on:
database-migrate:
condition: service_completed_successfully
database-influx:
condition: service_healthy
env_file:
- .env
environment:
FRONTEND_URL: http://localhost:3000
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_OPTS: sslmode=disable # sslmode=require for prod
REDIS_ADDRESS: ${REDIS_ADDRESS}
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_USE_TLS: false
database-redis:
image: redis:7.4-alpine3.20
volumes:
- bee-redis-data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 3s
timeout: 3s
retries: 3
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
database-migrate:
build:
context: backend
dockerfile: server.dockerfile
command: [ "/usr/local/bin/migrate", "up" ]
depends_on:
database-postgres:
condition: service_healthy
env_file:
- .env
environment:
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_OPTS: sslmode=disable
database-postgres:
image: postgres:17.0-alpine3.20
ports:
- "5432:5432" # only needed to connect to the database during local development
volumes:
- bee-postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 3s
timeout: 3s
retries: 3
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
executor:
build: executor
init: true
depends_on:
database-migrate:
condition: service_completed_successfully
database-influx:
condition: service_healthy
env_file:
- .env
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
database-influx:
image: influxdb:2.7-alpine
ports:
- "8086:8086" # only needed to connect to the database during local development
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: beeci
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET}
volumes:
- type: volume
source: bee-influx-data
target: /var/lib/influxdb2
- type: volume
source: bee-influx-config
target: /etc/influxdb2
healthcheck:
test: [ "CMD-SHELL", "influx ping" ]
interval: 2s
timeout: 2s
retries: 3
volumes:
bee-influx-data:
bee-influx-config:
bee-postgres-data:
bee-redis-data: