-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (82 loc) · 2.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
85 lines (82 loc) · 2.11 KB
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
82
83
84
85
services:
business-dashboard:
container_name: acme-business-dashboard
build:
context: .
dockerfile: ./packages/www/apps/business-dashboard/other/Dockerfile
target: development
platform: linux/amd64
restart: always
ports:
- 3000:3000
networks:
- app_network
env_file:
- ./packages/www/apps/business-dashboard/.env
environment:
DATABASE_URL: postgres://postgres:admin@postgres:5432/acme_docker
develop:
watch:
- action: sync
path: ./packages/www/apps/business-dashboard
target: /app/apps/business-dashboard
ignore:
- node_modules/
- action: rebuild
path: ./packages/www/apps/business-dashboard/package.json
- action: rebuild
path: ./packages/www/apps/business-dashboard/Dockerfile
- action: rebuild
path: packages
postgres:
container_name: acme-postgres
build:
context: .
dockerfile: ./packages/database/Dockerfile
restart: always
environment:
POSTGRES_DB: acme_docker
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
# Add these PostgreSQL settings
POSTGRES_INITDB_ARGS: "--data-checksums"
command: >
postgres
-c shared_buffers=1GB
-c effective_cache_size=4GB
-c maintenance_work_mem=256MB
-c work_mem=32MB
-c random_page_cost=1.1
-c effective_io_concurrency=200
-c max_parallel_workers=4
-c max_parallel_workers_per_gather=2
-c max_worker_processes=4
-c max_connections=50
ports:
- "5434:5432"
volumes:
- acme_postgres_data:/var/lib/postgresql/data
networks:
- app_network
# Add resource constraints
shm_size: "1gb"
deploy:
resources:
limits:
memory: 6G
reservations:
memory: 2G
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U postgres -p 5432 -d acme_docker -h localhost",
]
interval: 1s
timeout: 1s
retries: 20
networks:
app_network:
driver: bridge
volumes:
acme_postgres_data: