-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (45 loc) · 1023 Bytes
/
docker-compose.yml
File metadata and controls
48 lines (45 loc) · 1023 Bytes
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
version: '3.9'
services:
postgres:
container_name: fastapi-gen-postgres
image: postgres:14-alpine
restart: unless-stopped
environment:
POSTGRES_HOST: postgres
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
volumes:
- db:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
networks:
- fastapi-gen
api:
build:
context: .
dockerfile: Dockerfile
ports:
- 8000:8000
container_name: fastapi-gen-api
restart: unless-stopped
volumes:
- .:/api
networks:
- fastapi-gen
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_NAME: ${POSTGRES_DB}
SECRET: ${SECRET}
SQLALCHEMY_SILENCE_UBER_WARNING: 1
depends_on:
- postgres
volumes:
db:
driver: local
networks:
fastapi-gen: