-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
53 lines (48 loc) · 1.38 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
version: '3'
services:
app:
container_name: app
image: "${SERVER_DOCKER_IMAGE}"
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: "jdbc:postgresql://db:${POSTGRES_PORT}/postgres"
SPRING_DATASOURCE_USERNAME: "${POSTGRES_USER}"
SPRING_DATASOURCE_PASSWORD: "${POSTGRES_PASSWORD}"
db:
image: 'postgres:14.10-alpine3.18'
container_name: db
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
volumes:
- ./postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_NAME}"
nginx:
image: nginx:1.21.5-alpine
container_name: nginx
depends_on:
- app
ports:
- 80:80
- 443:443
volumes:
- ./conf:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: certbot
depends_on:
- nginx
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;'"
volumes:
postgres_data: