All checks were successful
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 3s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Successful in 1m19s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Successful in 5s
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Successful in 0s
fix next/link prefetch/call twice(replace with a)
106 lines
4.5 KiB
YAML
106 lines
4.5 KiB
YAML
# Dev dependencies ของ judes-note — รันด้วย `docker compose up -d` (ทั้งคู่)
|
|
# หรือ `docker compose up -d minio` (ถ้าจะรัน DB แบบเดิมด้วย docker run)
|
|
#
|
|
# service `db` ใช้ชื่อ container/วอลุ่มเดียวกับคำสั่ง docker run เดิมใน README
|
|
# (วอลุ่ม pin ชื่อไม่มี prefix ของ compose ผ่าน `name:` ด้านล่าง) — ถ้ามี container
|
|
# judes-note-db เก่ารันอยู่ (สร้างด้วย docker run) ให้ `docker rm -f judes-note-db`
|
|
# ก่อน แล้ว compose จะต่อวอลุ่ม judes-note-db-data เดิมได้เลย ข้อมูลไม่หาย
|
|
services:
|
|
docedit:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/web.Dockerfile
|
|
restart: unless-stopped
|
|
environment:
|
|
- SECRET=${SECRET}
|
|
- PRIVATE_KEY_HEX=${PRIVATE_KEY_HEX}
|
|
- PUBLIC_KEY_HEX=${PUBLIC_KEY_HEX}
|
|
- EXTERNAL_API_KEY=${EXTERNAL_API_KEY}
|
|
- DOCVER_API_KEY=${DOCVER_API_KEY}
|
|
- DOCVER_TOKEN_SECRET=${DOCVER_TOKEN_SECRET}
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/note
|
|
### สำหรับโค้ดตัวอย่างระบบนอกเรียกเข้ามาไม่ได้ใช้ในระบบนี้ ห้ามเอาไช้
|
|
- DOCEDIT_BASE_URL=http://docedit:3000/docedit
|
|
- TICKET_SEC=300
|
|
- DOCX_WORKERS=4
|
|
|
|
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
|
|
|
|
db:
|
|
image: postgres:18-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
POSTGRES_DB: ${POSTGRES_DB:-note}
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
ports:
|
|
- "54322:5432"
|
|
volumes:
|
|
- judes-note-db-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Object storage ของกลุ่ม API เอกสาร versioning (docs/PLAN-DOCVER.md §6) —
|
|
# bucket docver ไม่ต้องสร้างเอง: app สร้างตอน first use ผ่าน ensureBucket
|
|
# (ใช้ registry ทางการของ MinIO ที่ quay.io + pin RELEASE — Docker Hub
|
|
# ของ minio/minio เจอ rate limit/เข้าไม่ได้บ่อย)
|
|
minio:
|
|
image: docker.io/pgsty/silo:RELEASE.2026-10-26T00-00-00Z
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
|
|
# MC_HOST_local: http://${MINIO_ROOT_USER}:${MINIO_ROOT_PASSWORD}@localhost:39000
|
|
MINIO_BROWSER_REDIRECT_URL: https://${APP_DOMAIN}/console/
|
|
ports:
|
|
- "${MINIO_PORT}:9000" # S3 API
|
|
- "9001:9001" # MinIO console
|
|
volumes:
|
|
- judes-note-minio-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
# สร้าง bucket docx-versions + docx-templates แบบ private (anonymous = none)
|
|
# idempotent — รันซ้ำได้ด้วย --ignore-existing
|
|
minio-init:
|
|
# quay.io mirror — Docker Hub ทำ minio/mc เป็น private แล้ว (pull access denied)
|
|
image: cgr.dev/chainguard/minio-client:latest-dev
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
set -e;
|
|
mc alias set local http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD;
|
|
mc mb --ignore-existing local/docx-versions;
|
|
mc mb --ignore-existing local/docx-templates;
|
|
mc anonymous set none local/docx-versions;
|
|
mc anonymous set none local/docx-templates;
|
|
echo 'MinIO buckets ready: docx-versions, docx-templates (private)';
|
|
"
|
|
|
|
volumes:
|
|
# pin ชื่อจริงไม่มี prefix <project>_ ของ compose ให้ตรงชื่อวอลุ่มจาก docker run เดิม
|
|
judes-note-db-data:
|
|
name: judes-note-db-data
|
|
judes-note-minio-data:
|
|
name: judes-note-minio-data
|