-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (49 loc) · 984 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
48
49
50
51
52
53
services:
api:
build:
context: .
dockerfile: Dockerfile
image: shorten_api:latest
container_name: shorten_api
env_file:
- ".env"
ports:
- "8000:8000"
networks:
- shorten-api_shared
depends_on:
- db
- cache
db:
image: postgres:15
container_name: postgres_db
env_file:
- ".env"
environment:
POSTGRES_DB: ${PG_DATABASE_NAME}
POSTGRES_USER: ${PG_USERNAME}
POSTGRES_PASSWORD: ${PG_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- shorten-api_shared
cache:
container_name: redis_cache
image: redis
ports:
- "6379:6379"
volumes:
- ./tools/docker/redis_data:/data
command: "redis-server /data/redis.conf"
env_file:
- ".env"
networks:
- shorten-api_shared
networks:
shorten-api_shared:
external: true
volumes:
postgres_data:
redis_data: