-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (45 loc) · 971 Bytes
/
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
# This docker compose is used for testing
version: "3.7"
x-logging: &default-logging
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
services:
postgres:
logging: *default-logging
restart: unless-stopped
image: postgres:15-alpine
volumes:
- db-data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_DB: nian
POSTGRES_PASSWORD: nian
POSTGRES_USER: nian
#expose:
#-5432
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U nian"]
interval: 10s
timeout: 5s
retries: 5
nianbot:
logging: *default-logging
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/nianbot:ro
tty: true
depends_on:
- postgres
env_file:
- .env
environment:
- DATABASE_HOST=postgres
volumes:
db-data: