-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcompose.yaml
More file actions
149 lines (139 loc) · 3.6 KB
/
Copy pathcompose.yaml
File metadata and controls
149 lines (139 loc) · 3.6 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
networks:
kws_main:
driver: bridge
kws_services:
driver: bridge
ipam:
config:
- subnet: ${SERVICES_SUBNET:-172.25.0.0/24}
gateway: ${SERVICES_GATEWAY:-172.25.0.1}
volumes:
#Main
postgres_db_data_kws:
redis_db_data_kws:
mq_kws:
#Services
postgres_db_service_data:
services:
# ------------------------------Main-------------------------------
postgres:
image: postgres:17-alpine
container_name: postgres_db_kws
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DBNAME}
volumes:
- postgres_db_data_kws:/var/lib/postgresql/data:rw
ports:
- "127.0.0.1:${DB_PORT}:${DB_PORT}"
networks:
- kws_main
rabbitmq:
image: rabbitmq:4.0.7-management-alpine
container_name: mq_q_kws
restart: always
env_file:
- .env
environment:
- RABBITMQ_DEFAULT_USER=${MQ_USER}
- RABBITMQ_DEFAULT_PASS=${MQ_PASSWORD}
ports:
- "127.0.0.1:${MQ_SERVER_PORT}:${MQ_SERVER_PORT}"
- "127.0.0.1:${MQ_UI_PORT}:${MQ_UI_PORT}"
volumes:
- mq_kws:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 5s
retries: 5
networks:
- kws_main
redis:
image: redis:alpine
container_name: redis_db_kws
volumes:
- redis_db_data_kws:/data:rw
ports:
- "127.0.0.1:${REDIS_PORT}:${REDIS_PORT}"
env_file:
- .env
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
restart: always
networks:
- kws_main
nginx:
image: nginx:latest
container_name: nginx_proxy
network_mode: "host"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:rw
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/log/nginx:/var/log/nginx
ports:
- "80:80"
- "443:443"
depends_on:
- kws_gateway
kws_gateway:
image: golang:latest
container_name: kws_gateway
privileged: true
restart: unless-stopped
volumes:
- ./nginx/conf.d:/app/nginx_conf:rw
- ./src/:/app/data
- ./kws_config.yaml:/app/kws_config.yaml
- /var/run/docker.sock:/var/run/docker.sock
- /var/snap/lxd/common/lxd/unix.socket:/var/snap/lxd/common/lxd/unix.socket
- /etc/wireguard:/etc/wireguard:ro
network_mode: "host"
ports:
- "8080:8080"
depends_on:
- postgres
- redis
- rabbitmq
- postgres_service
working_dir: /app/data/cmd
command: sh -c "apt-get update && apt-get install -y uuid-runtime && go run ."
dnsmasq:
image: strm/dnsmasq
container_name: dnsmasq_kws
restart: unless-stopped
cap_add:
- NET_ADMIN
volumes:
- ./dnsmasq.conf:/etc/dnsmasq.conf:ro
networks:
- kws_main
# ------------------------------Services-------------------------------
postgres_service:
image: postgres:17-alpine
container_name: postgres.kws.services
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_USER: ${PG_SERVICE_USERNAME}
POSTGRES_PASSWORD: ${PG_SERVICE_PASSWORD}
POSTGRES_DB: ${PG_SERVICE_DB}
volumes:
- postgres_db_service_data:/var/lib/postgresql/data:rw
ports:
- "127.0.0.1:${PG_SERVICE_PORT}:5432"
networks:
kws_services:
ipv4_address: ${PG_SERVICE_IP:-172.25.0.2}
adminer:
image: adminer
container_name: adminer.kws.services
restart: always
networks:
kws_services:
ipv4_address: ${ADMINER_IP:-172.25.0.4}