-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (49 loc) · 1.04 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
version: '3.8'
services:
app:
container_name: LibraryAPI
build: .
ports:
- 8000:8000
restart: on-failure
volumes:
- api:/usr/src/app/
depends_on:
- db
- cache
networks:
- netapi
db:
image: postgres:latest
container_name: LibraryAPI_DB
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- netapi
cache:
image: redis:6.2-alpine
container_name: LibraryAPI_Cache
environment:
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
command: >
--requirepass ${REDIS_PASS}
ports:
- '6379:6379'
networks:
- netapi
# volumes used to persist data
volumes:
api:
postgres_data:
# Networks to be created to facilitate communication between containers
networks:
netapi:
driver: bridge