From ef86da726402f38ac9f3e405240abb5c50c649bb Mon Sep 17 00:00:00 2001 From: hong seokho Date: Tue, 30 Jul 2024 10:45:16 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20log=20=ED=8C=8C=EC=9D=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A7=91=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../animation-application-prod-ci-cd-flow.yml | 2 +- backend/AnimatedDrawings/Dockerfile | 2 ++ backend/AnimatedDrawings/supervisord.conf | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/animation-application-prod-ci-cd-flow.yml b/.github/workflows/animation-application-prod-ci-cd-flow.yml index 4f21b7266..7c967e97a 100644 --- a/.github/workflows/animation-application-prod-ci-cd-flow.yml +++ b/.github/workflows/animation-application-prod-ci-cd-flow.yml @@ -86,7 +86,7 @@ jobs: aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username ${{ secrets.AWS_DOCKER_USER }} --password-stdin ${{ secrets.AWS_USER_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com docker image prune -f docker pull ${{ steps.meta.outputs.tags }} - docker run -d -p 5555:5555 -p 9001:9001 --name animated_drawings -e ENVIRONMENT='dev' ${{ steps.meta.outputs.tags }} + docker run -d -p 5555:5555 -p 9001:9001 --name animated_drawings -v log_volume:/app/application/log -e ENVIRONMENT='dev' ${{ steps.meta.outputs.tags }} - name: Remove Github Actions IP from security group if: always() diff --git a/backend/AnimatedDrawings/Dockerfile b/backend/AnimatedDrawings/Dockerfile index 10a575a4a..61cd8c0a1 100644 --- a/backend/AnimatedDrawings/Dockerfile +++ b/backend/AnimatedDrawings/Dockerfile @@ -25,4 +25,6 @@ RUN pip install -e . WORKDIR /app/application +RUN mkdir log + CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/backend/AnimatedDrawings/supervisord.conf b/backend/AnimatedDrawings/supervisord.conf index 613930b30..399d395f9 100644 --- a/backend/AnimatedDrawings/supervisord.conf +++ b/backend/AnimatedDrawings/supervisord.conf @@ -12,8 +12,8 @@ directory = /app/application command = /opt/conda/envs/animated_drawings/bin/celery -A celery_app flower --conf="/app/application/config/flowerconfig.py" priority = 100 loglevel=info -stdout_logfile = /var/log/flower.log -stderr_logfile = /var/log/flower.err +stdout_logfile = /app/application/log/flower.log +stderr_logfile = /app/application/log/flower.err stdout_logfile_maxbytes = 50MB stdout_logfile_backups = 30 stderr_logfile_maxbytes = 50MB @@ -24,8 +24,8 @@ directory = /app/application command = /opt/conda/envs/animated_drawings/bin/python3 -u animation_queue.py loglevel=info priority = 100 -stdout_logfile = /var/log/application.log -stderr_logfile = /var/log/application.err +stdout_logfile = /app/application/log/application.log +stderr_logfile = /app/application/log/application.err stdout_logfile_maxbytes = 50MB stdout_logfile_backups = 30 stderr_logfile_maxbytes = 50MB @@ -37,8 +37,8 @@ directory = /app/application command = /opt/conda/envs/animated_drawings/bin/celery -A celery_app worker priority = 200 loglevel=info -stdout_logfile = /var/log/celeryd.log -stderr_logfile = /var/log/celeryd.err +stdout_logfile = /app/application/log/celeryd.log +stderr_logfile = /app/application/log/celeryd.err stdout_logfile_maxbytes = 50MB stdout_logfile_backups = 30 stderr_logfile_maxbytes = 50MB