-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (47 loc) · 1 KB
/
docker-compose.yml
File metadata and controls
50 lines (47 loc) · 1 KB
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
version: "3.9"
services:
fastapi:
build:
context: .
dockerfile: app/docker/Dockerfile
container_name: fastapi-container
restart: "always"
ports:
- "8080:8000"
volumes:
- .:/app
environment:
- DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
- REDIS_URL=${REDIS_URL}
depends_on:
- postgres
- redis
networks:
- backend
postgres:
image: postgres:14.16
container_name: postgres-container
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
networks:
- backend
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:alpine
container_name: redis-container
restart: always
ports:
- "6379:6379"
networks:
- backend
networks:
backend:
driver: bridge
volumes:
postgres-data: