forked from immersion-gg/Immersion.gg-Back
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
123 lines (120 loc) · 3.67 KB
/
docker-compose.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
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
version: "3.8"
networks:
app-tier:
driver: bridge
services:
immersion-riot-app:
container_name: immersion-riot-app
networks:
- app-tier
depends_on:
- redis
- kafka
image: ghcr.io/jiwonkkang/immersion-riot-app:latest
environment:
- SPRING_DATASOURCE_HOST=${SPRING_DATASOURCE_HOST}
- SPRING_DATASOURCE_PORT=${SPRING_DATASOURCE_PORT}
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
- SPRING_REDIS_HOST=${SPRING_REDIS_HOST}
- SPRING_REDIS_PORT=${SPRING_REDIS_PORT}
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE}
- RIOT_API_KEY=${RIOT_API_KEY}
ports:
- "8080:8080"
restart: always
immersion-gpt-app:
container_name: immersion-gpt-app
networks:
- app-tier
depends_on:
- immersion-riot-app
image: ghcr.io/jiwonkkang/immersion-gpt-app:latest
environment:
- SPRING_DATASOURCE_HOST=${SPRING_DATASOURCE_HOST}
- SPRING_DATASOURCE_PORT=${SPRING_DATASOURCE_PORT}
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
- GPT_API_KEY=${GPT_API_KEY}
ports:
- "8081:8081"
restart: always
redis:
container_name: immersion-redis
networks:
- app-tier
image: redis:latest
ports:
- "6379:6379"
zookeeper:
container_name: immersion-zookeeper
image: confluentinc/cp-zookeeper:latest
networks:
- app-tier
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ports:
- "22181:2181"
kafka:
container_name: immersion-kafka
image: confluentinc/cp-kafka:latest
networks:
- app-tier
depends_on:
- zookeeper
ports:
- "29092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
init-kafka:
container_name: immersion-init-kafka
image: confluentinc/cp-kafka:latest
networks:
- app-tier
depends_on:
- kafka
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server kafka:9092 --list
echo -e 'Creating kafka topics'
kafka-topics --create --if-not-exists --topic chatGpt --bootstrap-server kafka:9092 --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics --bootstrap-server kafka:9092 --list
"
nginx:
image: nginx:1.15-alpine
networks:
- app-tier
depends_on:
- immersion-riot-app
restart: unless-stopped
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- ./data/build:/usr/share/nginx/html # react deploy
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
networks:
- app-tier
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"