Skip to content

Commit

Permalink
Merge pull request #2776 from WesleyAC/production-add-log-retention
Browse files Browse the repository at this point in the history
Add default retention policy to containers
  • Loading branch information
mouse-reeve authored Apr 7, 2023
2 parents 419e9f2 + fe020b7 commit e00e7c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
version: '3'

x-logging:
&default-logging
driver: "json-file"
options:
max-size: "150m"
max-file: "2"

services:
nginx:
image: nginx:latest
logging: *default-logging
restart: unless-stopped
ports:
- "80:80"
Expand All @@ -21,6 +29,7 @@ services:
image: certbot/certbot:latest
command: certonly --webroot --webroot-path=/var/www/certbot --email ${EMAIL} --agree-tos --no-eff-email -d ${DOMAIN} -d www.${DOMAIN}
#command: renew --webroot --webroot-path /var/www/certbot
logging: *default-logging
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/logs:/var/log/letsencrypt
Expand All @@ -39,6 +48,7 @@ services:
build: .
env_file: .env
command: gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:8000
logging: *default-logging
volumes:
- .:/app
- static_volume:/app/static
Expand All @@ -54,6 +64,7 @@ services:
redis_activity:
image: redis
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes --port ${REDIS_ACTIVITY_PORT}
logging: *default-logging
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_activity_data:/data
Expand All @@ -64,6 +75,7 @@ services:
redis_broker:
image: redis
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes --port ${REDIS_BROKER_PORT}
logging: *default-logging
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_broker_data:/data
Expand All @@ -77,6 +89,7 @@ services:
networks:
- main
command: celery -A celerywyrm worker -l info -Q high_priority,medium_priority,low_priority,imports,broadcast
logging: *default-logging
volumes:
- .:/app
- static_volume:/app/static
Expand All @@ -91,6 +104,7 @@ services:
networks:
- main
command: celery -A celerywyrm beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
logging: *default-logging
volumes:
- .:/app
- static_volume:/app/static
Expand All @@ -101,6 +115,7 @@ services:
flower:
build: .
command: celery -A celerywyrm flower --basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD} --url_prefix=flower
logging: *default-logging
env_file: .env
volumes:
- .:/app
Expand Down

0 comments on commit e00e7c1

Please sign in to comment.