generated from yandex-praktikum/client-server-template-with-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (64 loc) · 1.46 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
version: "3.9"
networks:
chapecker-network:
driver: bridge
services:
client:
container_name: prakticum-client
image: prakticum-client
build:
context: .
dockerfile: ./Dockerfile.client
args:
CLIENT_PORT: ${CLIENT_PORT}
restart: always
ports:
- "${CLIENT_PORT}:80"
environment:
- CLIENT_PORT=${CLIENT_PORT}
- SERVER_PORT=${SERVER_PORT}
networks:
- chapecker-network
server:
container_name: prakticum-server
image: prackicum-server
depends_on:
- postgres
- client
build:
context: .
dockerfile: ./Dockerfile.server
args:
NODE_ENV: ${NODE_ENV}
SERVER_PORT: ${SERVER_PORT}
restart: always
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
environment:
SERVER_PORT: ${SERVER_PORT}
NODE_ENV: ${NODE_ENV}
networks:
- chapecker-network
postgres:
container_name: prakticum-database
image: postgres:14
restart: always
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT_INTERNAL}"
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./tmp/pgdata:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"
]
interval: 10s
timeout: 3s
retries: 3
networks:
- chapecker-network