From c98c13efaf872b7071287fd08da804616ec7186f Mon Sep 17 00:00:00 2001 From: asitisdev Date: Wed, 10 Jun 2026 13:24:05 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20=EB=A9=94=EC=9D=BC=EC=83=81?= =?UTF-8?q?=EC=9E=90=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20PR=20?= =?UTF-8?q?=EB=A9=94=EC=8B=9C=EC=A7=80=20=EA=B0=84=EC=86=8C=ED=99=94=20(#1?= =?UTF-8?q?62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-pr.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 58faf968..7988b0b9 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -69,9 +69,15 @@ jobs: source_commit_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${source_sha}" fi + display_tag="$image_tag" + if [[ "$image_tag" == sha-* ]]; then + display_tag="${image_tag:4:7}" + fi + { echo "should_update=${should_update}" echo "image_tag=${image_tag}" + echo "display_tag=${display_tag}" echo "source_sha=${source_sha}" echo "source_commit_url=${source_commit_url}" echo "workflow_run_url=${workflow_run_url}" @@ -117,8 +123,8 @@ jobs: branch: automation/mailsangja base: main delete-branch: true - commit-message: "release: 메일상자 이미지 업데이트 (${{ steps.meta.outputs.image_tag }})" - title: "release: 메일상자 이미지 업데이트 (${{ steps.meta.outputs.image_tag }})" + commit-message: "release: 메일상자 업데이트 (${{ steps.meta.outputs.display_tag }})" + title: "release: 메일상자 업데이트 (${{ steps.meta.outputs.display_tag }})" body: | Automated image tag update from `mailsangja-server`. @@ -133,7 +139,6 @@ jobs: - `apps/mailsangja/core.yaml` - `apps/mailsangja/worker.yaml` - `apps/mailsangja/postgres.yaml` is intentionally unchanged. Merge this PR to let Argo CD sync the new application images. add-paths: | apps/mailsangja/core.yaml From 5827ef8eed097bf85399eca618bc04591868c22b Mon Sep 17 00:00:00 2001 From: asitisdev Date: Wed, 10 Jun 2026 13:37:29 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20Postgres=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=B9=8C=EB=93=9C=20=ED=8C=8C=EC=9D=B4=ED=94=84?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EB=B6=84=EB=A6=AC=20(#162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-image.yml | 38 --------------- .github/workflows/build-postgres-image.yml | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/build-postgres-image.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 0e7d6af3..7005c749 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -13,44 +13,6 @@ permissions: contents: read jobs: - build-postgres: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - - name: Log in to GHCR - uses: docker/login-action@v4 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Derive postgres image name - id: postgres-image - shell: bash - run: echo "name=${GITHUB_REPOSITORY_OWNER,,}/mailsangja-postgres" >> "$GITHUB_OUTPUT" - - - name: Build and push postgres image - uses: docker/build-push-action@v7 - with: - context: . - file: docker/postgres/Dockerfile - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ env.REGISTRY }}/${{ steps.postgres-image.outputs.name }}:sha-${{ github.sha }} - cache-from: type=gha,scope=postgres - cache-to: type=gha,scope=postgres,mode=max - build: runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/build-postgres-image.yml b/.github/workflows/build-postgres-image.yml new file mode 100644 index 00000000..7e4fef03 --- /dev/null +++ b/.github/workflows/build-postgres-image.yml @@ -0,0 +1,55 @@ +name: Build Postgres Docker Image + +on: + push: + branches: + - main + paths: + - docker/postgres/** + - .github/workflows/build-postgres-image.yml + workflow_dispatch: + +env: + REGISTRY: ghcr.io + +permissions: + contents: read + +jobs: + build-postgres: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Log in to GHCR + uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Derive postgres image name + id: postgres-image + shell: bash + run: echo "name=${GITHUB_REPOSITORY_OWNER,,}/mailsangja-postgres" >> "$GITHUB_OUTPUT" + + - name: Build and push postgres image + uses: docker/build-push-action@v7 + with: + context: . + file: docker/postgres/Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ env.REGISTRY }}/${{ steps.postgres-image.outputs.name }}:sha-${{ github.sha }} + cache-from: type=gha,scope=postgres + cache-to: type=gha,scope=postgres,mode=max From 3aef3bfa0721d14f86493384ad2f033584b37233 Mon Sep 17 00:00:00 2001 From: asitisdev Date: Wed, 10 Jun 2026 13:39:07 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20Postgres=20init=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EB=B6=84=EB=A6=AC=20(#162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-postgres-image.yml | 2 +- compose.yaml | 2 +- db/src/main/resources/init.sql | 2 +- .../extensions.sql => docker/postgres/init/00-extensions.sql | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename db/src/main/resources/extensions.sql => docker/postgres/init/00-extensions.sql (100%) diff --git a/.github/workflows/build-postgres-image.yml b/.github/workflows/build-postgres-image.yml index 7e4fef03..1d3cdccb 100644 --- a/.github/workflows/build-postgres-image.yml +++ b/.github/workflows/build-postgres-image.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - docker/postgres/** + - docker/postgres/Dockerfile - .github/workflows/build-postgres-image.yml workflow_dispatch: diff --git a/compose.yaml b/compose.yaml index 2a479049..c9a59108 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,7 +14,7 @@ services: - "${DB_PORT:-5432}:5432" volumes: - postgres_data:/var/lib/postgresql - - ./db/src/main/resources/extensions.sql:/docker-entrypoint-initdb.d/00-extensions.sql:ro + - ./docker/postgres/init/00-extensions.sql:/docker-entrypoint-initdb.d/00-extensions.sql:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-mailsangja}"] interval: 10s diff --git a/db/src/main/resources/init.sql b/db/src/main/resources/init.sql index 6494e002..641677eb 100644 --- a/db/src/main/resources/init.sql +++ b/db/src/main/resources/init.sql @@ -226,7 +226,7 @@ CREATE INDEX IF NOT EXISTS idx_threads_last_message_at ON threads(last_message_a -- WHERE filename_vector IS NULL; -- ── Full-Text Search (English, pg_trgm) ────────────────────────────────────── --- pg_trgm 확장은 extensions.sql(docker-entrypoint-initdb.d)에서 superuser로 설치됨 +-- pg_trgm 확장은 docker/postgres/init/00-extensions.sql(docker-entrypoint-initdb.d)에서 superuser로 설치됨 -- messages.search_text: 영어 부분/대소문자 무시 검색을 위한 소문자 정규화 텍스트 -- body_text는 인덱스 크기 제한을 위해 앞 5000자만 포함 diff --git a/db/src/main/resources/extensions.sql b/docker/postgres/init/00-extensions.sql similarity index 100% rename from db/src/main/resources/extensions.sql rename to docker/postgres/init/00-extensions.sql From 68da9eca6787b661be0232cab5c2ca509a1eaef0 Mon Sep 17 00:00:00 2001 From: asitisdev Date: Wed, 10 Jun 2026 13:50:28 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20Loki=20=EB=A6=AC=ED=85=90=EC=85=98?= =?UTF-8?q?=20=EC=A0=95=EC=B1=85=20=EC=B6=94=EA=B0=80=20(#162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/observability/loki/loki.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/observability/loki/loki.yaml b/docker/observability/loki/loki.yaml index ef2ece56..3e1f800b 100644 --- a/docker/observability/loki/loki.yaml +++ b/docker/observability/loki/loki.yaml @@ -26,6 +26,16 @@ storage_config: limits_config: allow_structured_metadata: true + retention_period: 336h + max_query_lookback: 336h + +compactor: + working_directory: /loki/compactor + compaction_interval: 10m + retention_enabled: true + retention_delete_delay: 2h + retention_delete_worker_count: 50 + delete_request_store: filesystem analytics: reporting_enabled: false