-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
64 lines (62 loc) · 1.2 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
version: '3.8'
networks:
mavy:
driver: bridge
services:
api:
container_name: api
build:
context: .
dockerfile: api.Dockerfile
ports:
- ${PORT}:${PORT}
- 9229:9229
environment:
PORT: ${PORT}
networks:
- mavy
restart: always
depends_on:
- database
- redis
database:
container_name: database
image: postgres:15-alpine
ports:
- ${DB_PORT}:5432
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_HOST=${DB_HOST}
restart: always
volumes:
- pgdata:${PG_DATA}
networks:
- mavy
redis:
container_name: redis
image: redis:latest
ports:
- ${REDIS_PORT}:6379
networks:
- mavy
restart: always
database-backup:
build:
context: .
dockerfile: backup.Dockerfile
tty: true
environment:
- POSTGRES_HOST=database
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PORT=${DB_PORT}
- PGPASSWORD=${DB_PASS}
depends_on: [database]
volumes:
- ./backups:/backup-files
networks:
- mavy
volumes:
pgdata: