-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
81 lines (76 loc) · 1.68 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
81
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: base-rbac-api
restart: always
ports:
- '8080:3333'
depends_on:
- postgres
- redis
env_file:
- .env
environment:
PORT: ${PORT}
HOST: ${HOST}
NODE_ENV: ${NODE_ENV}
APP_KEY: ${APP_KEY}
DRIVE_DISK: ${DRIVE_DISK}
DB_CONNECTION: ${DB_CONNECTION}
PG_HOST: postgres
PG_PORT: ${PG_PORT}
PG_USER: ${PG_USER}
PG_PASSWORD: ${PG_PASSWORD}
PG_DB_NAME: ${PG_DB_NAME}
REDIS_CONNECTION: ${REDIS_CONNECTION}
REDIS_HOST: redis
REDIS_PORT: ${REDIS_PORT}
REDIS_PASSWORD: ${REDIS_PASSWORD}
networks:
- app-network
postgres:
image: postgres:latest
container_name: base-rbac-postgres
healthcheck:
test: ['CMD', 'pg_isready', '-q', '-d', 'postgres', '-U', 'postgres']
timeout: 45s
interval: 10s
retries: 10
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- '5432:5432'
expose:
- 5432
volumes:
- database:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- app-network
redis:
image: redis:latest
restart: always
container_name: base-rbac-redis
command: redis-server --requirepass redis
environment:
- REDIS_REPLICATION_MODE=master
ports:
- '6379:6379'
expose:
- 6379
volumes:
- dbredis:/var/lib/redis/data
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
database:
dbredis: