Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/build-postgres-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Postgres Docker Image

on:
push:
branches:
- main
paths:
- docker/postgres/Dockerfile
- .github/workflows/build-postgres-image.yml
workflow_dispatch:

env:
REGISTRY: ghcr.io
Comment thread
asitisdev marked this conversation as resolved.
Resolved

permissions:
contents: read

jobs:
build-postgres:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
Comment thread
asitisdev marked this conversation as resolved.
Resolved
Comment thread
asitisdev marked this conversation as resolved.
Resolved

- 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
11 changes: 8 additions & 3 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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`.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion db/src/main/resources/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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자만 포함
Expand Down
10 changes: 10 additions & 0 deletions docker/observability/loki/loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading