/
docker-compose.yml
47 lines (45 loc) · 1017 Bytes
/
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
version: '3.7'
services:
backend:
image: ghcr.io/martinheinz/blog_backend
container_name: blog_backend
healthcheck:
test: ["CMD", "curl", "-f", "backend"]
interval: 30s
timeout: 10s
retries: 5
depends_on:
- blog_db
ports:
- 8080:8080
- 9080:9080
volumes:
- ./data/certbot/conf/live/${HOST}:/etc/certs
environment:
BACKEND_API_KEY: ${BACKEND_API_KEY}
blog_db:
image: martinheinz/blog_db:latest
build:
context: ./postgres
dockerfile: ./Dockerfile
container_name: db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- data:/var/lib/postgresql/data
expose:
- 5432
ports:
- 5431:5432
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
DB_NAME: "blog"
POSTGRES_DB: blog
PGPORT: 5432
POPULATE_DB: ${POPULATE_DB}
volumes:
data: {}