-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (63 loc) · 1.24 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.8'
services:
database:
restart: always
image: postgres:15.7
deploy:
resources:
limits:
memory: 300M
environment:
POSTGRES_DB: test-db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d test-db"]
interval: 1s
timeout: 3s
retries: 5
networks:
app-net:
aliases:
- database
logging:
driver: 'json-file'
options:
max-file: '2'
max-size: 20m
app:
restart: always
container_name: app
deploy:
resources:
limits:
memory: 100M
build:
context: .
dockerfile: Dockerfile
environment:
DB_URI: postgresql://postgres:password@database:5432/test-db
DB_LOGGING: false
# env_file:
# - development.env
networks:
app-net:
ports:
- 3000:3000
depends_on:
database:
condition: service_healthy
logging:
driver: 'json-file'
options:
max-file: '2'
max-size: 20m
networks:
app-net:
driver: bridge
volumes:
postgres-data: