-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 2.2 KB
/
docker-compose.yml
File metadata and controls
89 lines (84 loc) · 2.2 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
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
81
82
83
84
85
86
87
88
89
services:
db:
profiles: ["db", "all"]
container_name: postgres
image: postgres:15.2
restart: always
env_file:
- .env
environment:
- POSTGRES_USER=${POSTGRES_USER:-root}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_DB=${POSTGRES_DB:-full_authorization}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- db
redis:
profiles: ["db", "all"]
container_name: redis
image: redis:8.2
restart: always
env_file:
- .env
ports:
- "${REDIS_PORT:-6379}:6379"
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-password}
command: redis-server --requirepass ${REDIS_PASSWORD:-password}
volumes:
- redis_data:/data
networks:
- db
backend:
profiles: ["app", "all"]
container_name: backend_app
build:
context: ./nest.js-server
dockerfile: Dockerfile
restart: always
env_file:
- .env
environment:
- POSTGRES_URI=${POSTGRES_URI:-postgresql://root:password@db:5432/full_authorization}
ports:
- "${APPLICATION_PORT:-4000}:4000"
volumes:
- ./nest.js-server:/usr/src/backend
- /usr/src/backend/node_modules
depends_on:
- db
- redis
networks:
- db
- app
command: >
sh -c "npx prisma@6 db push --accept-data-loss && npm run start:dev"
frontend:
profiles: ["app", "all"]
container_name: frontend_app
build:
context: ./next.js-client
dockerfile: Dockerfile
restart: always
env_file:
- .env
ports:
- "${FRONTEND_PORT:-3000}:3000"
volumes:
- ./next.js-client:/usr/src/next.js-client
- /usr/src/next.js-client/node_modules
- /usr/src/next.js-client/.next
depends_on:
- backend
networks:
- app
volumes:
postgres_data:
redis_data:
networks:
db:
internal: true
app: