Merge pull request #2776 from WesleyAC/production-add-log-retention

Add default retention policy to containers
This commit is contained in:
Mouse Reeve 2023-04-07 05:57:45 -07:00 committed by GitHub
commit e00e7c1890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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