Skip to content

Commit 48c9acc

Browse files
committed
chore: add log size limits to Docker Compose files
1 parent 118566d commit 48c9acc

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

docker-compose.ghcr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
version: '3.8'
2+
3+
# Define levels for log file size limits
4+
x-logging-low: &logging-low
5+
driver: "json-file"
6+
options:
7+
max-file: 5
8+
max-size: 5m
9+
10+
x-logging-medium: &logging-medium
11+
driver: "json-file"
12+
options:
13+
max-file: 5
14+
max-size: 10m
15+
16+
x-logging-high: &logging-high
17+
driver: "json-file"
18+
options:
19+
max-file: 5
20+
max-size: 50m
21+
222
services:
323
frontend:
424
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/frontend:main
@@ -11,6 +31,7 @@ services:
1131
- default
1232
# volumes:
1333
# - ./frontend:/dist # for hot reloading
34+
logging: *logging-medium
1435

1536
api:
1637
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/api:main
@@ -31,6 +52,7 @@ services:
3152
delay: 5s
3253
max_attempts: 3
3354
window: 120s
55+
logging: *logging-medium
3456

3557
gateway:
3658
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/gateway:main
@@ -49,6 +71,7 @@ services:
4971
delay: 5s
5072
max_attempts: 3
5173
window: 120s
74+
logging: *logging-medium
5275

5376
postgres:
5477
image: postgres:15.2
@@ -66,6 +89,7 @@ services:
6689
- POSTGRES_PASSWORD=postgres
6790
volumes:
6891
- pgdata:/var/lib/postgresql/data
92+
logging: *logging-medium
6993

7094
pgadmin:
7195
image: dpage/pgadmin4:7.1
@@ -87,6 +111,7 @@ services:
87111
interval: 30s
88112
timeout: 30s
89113
retries: 3
114+
logging: *logging-medium
90115

91116
redis:
92117
image: redis:7.0
@@ -103,6 +128,7 @@ services:
103128
interval: 30s
104129
timeout: 30s
105130
retries: 3
131+
logging: *logging-medium
106132

107133
volumes:
108134
pgdata:

docker-compose.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
version: '3.8'
2+
3+
# Define levels for log file size limits
4+
x-logging-low: &logging-low
5+
driver: "json-file"
6+
options:
7+
max-file: 5
8+
max-size: 5m
9+
10+
x-logging-medium: &logging-medium
11+
driver: "json-file"
12+
options:
13+
max-file: 5
14+
max-size: 10m
15+
16+
x-logging-high: &logging-high
17+
driver: "json-file"
18+
options:
19+
max-file: 5
20+
max-size: 50m
21+
22+
223
services:
324
frontend:
425
build:
@@ -13,7 +34,8 @@ services:
1334
- default
1435
# volumes:
1536
# - ./frontend:/dist # for hot reloading
16-
37+
logging: *logging-medium
38+
1739
api:
1840
build:
1941
context: ./
@@ -35,6 +57,7 @@ services:
3557
delay: 5s
3658
max_attempts: 3
3759
window: 120s
60+
logging: *logging-medium
3861

3962
gateway:
4063
build:
@@ -55,6 +78,7 @@ services:
5578
delay: 5s
5679
max_attempts: 3
5780
window: 120s
81+
logging: *logging-medium
5882

5983
postgres:
6084
image: postgres:15.2
@@ -72,6 +96,7 @@ services:
7296
- POSTGRES_PASSWORD=postgres
7397
volumes:
7498
- pgdata:/var/lib/postgresql/data
99+
logging: *logging-medium
75100

76101
pgadmin:
77102
image: dpage/pgadmin4:7.1
@@ -93,6 +118,7 @@ services:
93118
interval: 30s
94119
timeout: 30s
95120
retries: 3
121+
logging: *logging-medium
96122

97123
redis:
98124
image: redis:7.0
@@ -109,6 +135,7 @@ services:
109135
interval: 30s
110136
timeout: 30s
111137
retries: 3
138+
logging: *logging-medium
112139

113140
volumes:
114141
pgdata:

0 commit comments

Comments
 (0)