Skip to content

Commit

Permalink
Caddyfile secret 변수 주입 (#14)
Browse files Browse the repository at this point in the history
* feat/fix: apply NAT IP only AWS to LOKI request by Caddy
1. codedang AWS에서 오는 요청만 LOKI에서 수집하기 위해 Caddy에서 특정 NAT IP만 프록시하도록 설정하였습니다.
2. github action flow 를 보완하였습니다.
- Caddy를 reload하는 과정은 static frontend file mount가 정상적으로 작동하지 않았을 때 해결하는 과정이므로 불필요하다고 생각합니다.
- 사용하지 않는 volume을 삭제하는 과정은 추후 로그 분석시 이전 log가 삭제될 가능성을 염두하였을 때 불필요하다고 생각합니다.
- container가 running인지 확인하는 과정은 log container에 국한되므로, 이를 분리합니다.

* fix(Caddy): reload caddy not running compose caddy up always

* fix(Caddy): edit env variable of Caddyfile
  • Loading branch information
goathoon authored Jan 31, 2024
1 parent b0a10b8 commit 500018a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/update-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ jobs:
run: |
docker compose --profile caddy up -d --no-recreate
- name: Copy Caddyfile into Caddy Container
- name: Set Caddyfile Environment Variables
env:
AWS_REQ_IP: ${{ secrets.AWS_NAT_IP }}
AWS_REQ_IP: ${{ secrets.AWS_REQ_IP}}
run: |
sed -i "s/{$AWS_REQ_IP}/$AWS_REQ_IP/" ./Caddyfile
- name: Copy Caddyfile into Caddy Container
run: |
docker cp ./Caddyfile caddy:/etc/caddy/Caddyfile
Expand Down

0 comments on commit 500018a

Please sign in to comment.