This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yaml
88 lines (80 loc) · 1.91 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
version: '3.8'
services:
#Node 1
node-1:
image: cassandra:4.0
container_name: node-1
environment: &environment
- CASSANDRA_CLUSTER_NAME=cluster1
- CASSANDRA_DC=Mumbai
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- CASSANDRA_SEEDS=node-1
volumes:
- node1-vol:/var/lib/cassandra
- ./cassandra/node1/cassandra:/etc/cassandra
restart: always
# schema loading node
pseudo-node:
image: cassandra:4.0
container_name: pseudo-node
environment: *environment
volumes:
- ./cassandra/init_keyspace.cql:/schema.cql
depends_on:
- node-1
command: /bin/bash -c "sleep 60 && cqlsh node-1 -f /schema.cql -u cassandra -p cassandra"
restart: on-failure
# Backend
backend:
build:
context: backend
container_name: backend
depends_on:
- pseudo-node
env_file:
- .env
ports:
- "8000:8000"
restart: always
# Frontend
frontend:
build:
context: frontend
container_name: frontend
volumes:
- react_build:/frontend/build
# Redis
redis:
image: redis
depends_on:
- backend
restart: always
# Nginx service
nginx:
image: nginx:1.21-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- react_build:/usr/share/nginx/html
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- backend
- frontend
restart: always
#CertBot
certbot:
image: certbot/certbot
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;'"
depends_on:
- nginx
# Volumes
volumes:
node1-vol:
react_build: