This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
101 lines (100 loc) · 3.15 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
version: '3.8'
services:
influxdb: # TODO: configure dashboards
container_name: ${INFLUXDB_CONTAINER_NAME}
image: influxdb:2.6.1-alpine
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUXDB_USERNAME}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: default
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN}
restart: always
# healthcheck:
# # test: "curl -f http://localhost:8086/ping"
# test: ${INFLUXDB_SERVICE_HEALTHCHECK_CMD}
# interval: 3s
# timeout: 10s
# retries: 5
ports:
- ${INFLUXDB_PORT}:${INFLUXDB_PORT}
postgres:
container_name: ${POSTGRES_CONTAINER_NAME}
image: postgres:15.2-alpine3.17
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DBNAME}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /data/postgres
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
networks:
- persistent_bridge_network
depends_on:
- influxdb
pgadmin:
container_name: pgadmin4
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5050:80"
depends_on:
postgres:
condition: service_healthy
redis:
container_name: redis
image: redis:7.0.8-alpine3.17
environment:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PASSWORD: ${REDIS_PASSWORD}
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
ports:
- ${REDIS_PORT}:${REDIS_PORT}
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- redis:/data
depends_on:
postgres:
condition: service_healthy
backend:
container_name: backend
build:
context: ./
dockerfile: api.Dockerfile
image: golang-backend
restart: always
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
depends_on:
influxdb:
condition: service_started
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
redis:
driver: local
postgres:
driver: local
networks:
persistent_bridge_network:
driver: bridge