-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (75 loc) · 1.75 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
services:
frontend:
build:
context: .
dockerfile: ./frontend/docker/Dockerfile
container_name: next_app
restart: unless-stopped
ports:
- "${FRONTEND_PORT}:3000"
volumes:
- ./frontend:/app
env_file:
- .env
depends_on:
- backend
- postgres
networks:
- backend_network
backend:
build:
context: .
dockerfile: ./backend/docker/Dockerfile
container_name: fastapi_app
restart: unless-stopped
ports:
- "${BACKEND_PORT}:80"
volumes:
- ./backend:/app
env_file:
- .env
depends_on:
- postgres
environment:
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
networks:
- backend_network
postgres:
image: postgres:latest
container_name: postgres
restart: unless-stopped
ports:
- "${DB_PORT}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
networks:
- backend_network
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
restart: unless-stopped
ports:
- "${PGADMIN_PORT}:5050"
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
PGADMIN_LISTEN_PORT: 5050
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
PGADMIN_ENABLE_PASSWORD_RECOVERY: 'True'
volumes:
- ./backend/docker/pgadmin/servers.json:/pgadmin4/servers.json
networks:
- backend_network
depends_on:
- postgres
networks:
backend_network:
driver: bridge
volumes:
pgdata:
pgadmin_data: