Skip to content

Commit

Permalink
feat(celery): new volume path
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamad-liyaghi committed Aug 10, 2024
1 parent 9ce0a85 commit f80d13c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docker-compose.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
command: sh ./docker/scripts/celery.sh
volumes:
- .:/src
- ./logs/celery.log:/var/log/celery.log
- ./logs/celery:/var/log/celery
networks:
- main
depends_on:
Expand All @@ -29,10 +29,10 @@ services:
celery-beat:
restart: on-failure
container_name: food-anywhere-celery-beat
command: sh ./docker/scripts/celery.sh
command: sh ./docker/scripts/celery-beat.sh
volumes:
- .:/src
- ./logs/celery.log:/var/log/celery-beat.log
- ./logs/celery-beat/:/var/log/celery-beat/
networks:
- main
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions docker/scripts/celery-beat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ else
fi

echo "Creating Log File"
if [ ! -f /var/log/celery-beat.log ]; then
touch /var/log/celery-beat.log
if [ ! -f /var/log/celery-beat/info.log ]; then
touch /var/log/celery-beat/info.log
fi

echo "Running celery beat worker..."
celery -A config beat --loglevel=$LOGLEVEL -f /var/log/celery-beat.log
celery -A config beat --loglevel=$LOGLEVEL -f /var/log/celery-beat/info.log
6 changes: 3 additions & 3 deletions docker/scripts/celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ else
LOGLEVEL="DEBUG"
fi
echo "Creating Log File"
if [ ! -f /var/log/celery.log ]; then
touch /var/log/celery.log
if [ ! -f /var/log/celery/info.log ]; then
touch /var/log/celery/info.log
fi

echo "Running celery worker..."
celery -A config worker --loglevel=$LOGLEVEL -f /var/log/celery.log
celery -A config worker --loglevel=$LOGLEVEL -f /var/log/celery/info.log
4 changes: 2 additions & 2 deletions promtail/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ scrape_configs:
- targets:
- celery
labels:
__path__: "/var/log/celery.log"
__path__: "/var/log/celery/info.log"
app: celery

- job_name: celery-beat-log-scraper
static_configs:
- targets:
- celery-beat
labels:
__path__: "/var/log/celery-beat.log"
__path__: "/var/log/celery-beat/info.log"
app: celery-beat

0 comments on commit f80d13c

Please sign in to comment.