Skip to content

Commit

Permalink
chore: add log size limits to Docker Compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
basarbyz committed Oct 14, 2024
1 parent 118566d commit 48c9acc
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docker-compose.ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
version: '3.8'

# Define levels for log file size limits
x-logging-low: &logging-low
driver: "json-file"
options:
max-file: 5
max-size: 5m

x-logging-medium: &logging-medium
driver: "json-file"
options:
max-file: 5
max-size: 10m

x-logging-high: &logging-high
driver: "json-file"
options:
max-file: 5
max-size: 50m

services:
frontend:
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/frontend:main
Expand All @@ -11,6 +31,7 @@ services:
- default
# volumes:
# - ./frontend:/dist # for hot reloading
logging: *logging-medium

api:
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/api:main
Expand All @@ -31,6 +52,7 @@ services:
delay: 5s
max_attempts: 3
window: 120s
logging: *logging-medium

gateway:
image: ghcr.io/n5geh/n5geh.tools.mqtt-gateway/gateway:main
Expand All @@ -49,6 +71,7 @@ services:
delay: 5s
max_attempts: 3
window: 120s
logging: *logging-medium

postgres:
image: postgres:15.2
Expand All @@ -66,6 +89,7 @@ services:
- POSTGRES_PASSWORD=postgres
volumes:
- pgdata:/var/lib/postgresql/data
logging: *logging-medium

pgadmin:
image: dpage/pgadmin4:7.1
Expand All @@ -87,6 +111,7 @@ services:
interval: 30s
timeout: 30s
retries: 3
logging: *logging-medium

redis:
image: redis:7.0
Expand All @@ -103,6 +128,7 @@ services:
interval: 30s
timeout: 30s
retries: 3
logging: *logging-medium

volumes:
pgdata:
Expand Down
29 changes: 28 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
version: '3.8'

# Define levels for log file size limits
x-logging-low: &logging-low
driver: "json-file"
options:
max-file: 5
max-size: 5m

x-logging-medium: &logging-medium
driver: "json-file"
options:
max-file: 5
max-size: 10m

x-logging-high: &logging-high
driver: "json-file"
options:
max-file: 5
max-size: 50m


services:
frontend:
build:
Expand All @@ -13,7 +34,8 @@ services:
- default
# volumes:
# - ./frontend:/dist # for hot reloading

logging: *logging-medium

api:
build:
context: ./
Expand All @@ -35,6 +57,7 @@ services:
delay: 5s
max_attempts: 3
window: 120s
logging: *logging-medium

gateway:
build:
Expand All @@ -55,6 +78,7 @@ services:
delay: 5s
max_attempts: 3
window: 120s
logging: *logging-medium

postgres:
image: postgres:15.2
Expand All @@ -72,6 +96,7 @@ services:
- POSTGRES_PASSWORD=postgres
volumes:
- pgdata:/var/lib/postgresql/data
logging: *logging-medium

pgadmin:
image: dpage/pgadmin4:7.1
Expand All @@ -93,6 +118,7 @@ services:
interval: 30s
timeout: 30s
retries: 3
logging: *logging-medium

redis:
image: redis:7.0
Expand All @@ -109,6 +135,7 @@ services:
interval: 30s
timeout: 30s
retries: 3
logging: *logging-medium

volumes:
pgdata:
Expand Down

0 comments on commit 48c9acc

Please sign in to comment.