-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (72 loc) · 1.66 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
version: "3.7"
services:
todoapp_redis:
image: redis
container_name: todoapp_redis
networks:
- webnet
todoapp_db:
container_name: todoapp_db
image: postgres
networks:
- webnet
# постгрес выполняет скрипты, замаунченые в этом каталоге
volumes:
- ./server/pg-init-scripts:/docker-entrypoint-initdb.d
environment:
# POSTGRES_DB: ${DBNAME}
POSTGRES_MULTIPLE_DATABASES: ${DBNAME},${DBNAME}_test
POSTGRES_USER: ${DBUSER}
POSTGRES_PASSWORD: ${DBPASSWORD}
todoapp_server:
build:
context: ./server
dockerfile: Dockerfile
target: production
container_name: todoapp_server
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
networks:
- webnet
environment:
DB_HOST: todoapp_db
REDIS_HOST: todoapp_redis
# TODO: может зафакапить тесты из-за орм конфига
NODE_ENV: production
depends_on:
- todoapp_db
- todoapp_redis
env_file:
- .env
# command: npm run start
command:
[
"bash",
"./wait-for-it.sh",
"todoapp_db:5432",
"--",
"npm",
"run",
"start",
]
todoapp_client:
build:
context: ./client
dockerfile: Dockerfile
target: production
container_name: todoapp_client
ports:
- "3000:3000"
networks:
- webnet
environment:
API_HOST: todoapp_server
NEXT_PUBLIC_API_PORT: ${SERVER_PORT}
# NODE_ENV: production
depends_on:
- todoapp_server
env_file:
- .env
command: npm run start
networks:
webnet: