-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yaml
60 lines (54 loc) · 1.02 KB
/
docker-compose.yaml
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
version: "3.9"
services:
fastapi_service:
build:
context: ./app
dockerfile: Dockerfile
hostname: fastapi_service
container_name: fastapi_service
depends_on:
- db_postgres
ports:
- "8000:8000"
env_file:
- app/.env
volumes:
- ./app:/home/app
networks:
- my-net
cache-redis:
image: redis:alpine
hostname: cache-redis
container_name: cache-redis
restart: on-failure
ports:
- '6379:6379'
expose:
- '6379'
command: redis-server
volumes:
- cache:/data
networks:
- my-net
db_postgres:
image: postgres:14.3-alpine
hostname: db_postgres
container_name: db_postgres
restart: on-failure
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5434:5432"
volumes:
- db-postgres:/var/lib/postgresql/data
networks:
- my-net
volumes:
db-postgres:
driver: local
cache:
driver: local
networks:
my-net:
external: true