-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·110 lines (104 loc) · 2.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·110 lines (104 loc) · 2.83 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
services:
db:
image: postgres:15
container_name: findMe_postgres_db
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- findMe:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- findme-shared-network
redis:
image: redis:8.2.3
container_name: findMe_redis
restart: always
command: [
"redis-server", "--appendonly", "yes",
"--requirepass", "${REDIS_PASS}",
"--maxmemory", "50mb",
"--maxmemory-policy", "volatile-ttl"
]
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- findme-shared-network
app:
build:
context: .
dockerfile: Dockerfile
container_name: findMe_app
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=db
- REDIS_PASS=${REDIS_PASS}
- REDIS_ADDR=redis:6379
- JWTSECRET=${JWTSECRET}
- GIT_CLIENT_ID=${GIT_CLIENT_ID}
- GIT_CLIENT_SECRET=${GIT_CLIENT_SECRET}
- GIT_CALLBACK_URL=${GIT_CALLBACK_URL}
- EMAIL=${EMAIL}
- EMAIL_APP_PASSWORD=${EMAIL_APP_PASSWORD}
- PAYSTACK_API_KEY=${PAYSTACK_API_KEY}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 120s
timeout: 10s
retries: 3
start_period: 40s
networks:
- findme-shared-network
nginx:
image: nginx:alpine
container_name: findMe_nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
depends_on:
app:
condition: service_healthy
networks:
- findme-shared-network
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: findMe_certbot
restart: always
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
- findme-shared-network
networks:
findme-shared-network:
external: true
volumes:
findMe:
redis-data: