-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (67 loc) · 1.54 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
version: "3.7"
services:
db:
container_name: chat-db
image: postgres:alpine
restart: on-failure
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pass}
POSTGRES_USER: ${POSTGRES_USER:-user}
PGDATA: /data/postgres
healthcheck:
test: pg_isready -U user
interval: 30s
timeout: 5s
retries: 5
volumes:
- postgres:/data/postgres
networks:
- postgres
redis:
container_name: chat-storage
image: redis:alpine
restart: on-failure
healthcheck:
test: redis-cli ping
interval: 30s
timeout: 5s
retries: 5
networks:
- redis
server:
container_name: chat-app
image: chat-app:1.0
restart: on-failure
depends_on:
- db
environment:
JWT_SECRET: ${JWT_SECRET:-}
ORIGIN: ${ORIGIN:-localhost}
POSTGRES_DATABASE: ${POSTGRES_DATABASE:-chat}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pass}
POSTGRES_USER: ${POSTGRES_USER:-user}
POSTGRES_HOST: ${POSTGRES_HOST:-chat-db}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
REDIS_HOST: ${REDIS_HOST:-chat-storage}
build:
context: .
target: websocket-chat
dockerfile: docker/Dockerfile
healthcheck:
test: curl --fail -s http://localhost:8080/api/health || exit 1
interval: 30s
timeout: 5s
retries: 5
ports:
- 8080:8080
networks:
- postgres
- redis
networks:
postgres:
driver: bridge
redis:
driver: bridge
volumes:
postgres: