Refactor code structure for improved readability and maintainability
This commit is contained in:
parent
f8d64e4e7d
commit
66f592ee2e
6 changed files with 19 additions and 14 deletions
|
|
@ -15,7 +15,7 @@ services:
|
|||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
ports:
|
||||
- "5432:5432" # เปิดให้ backend ที่รันด้วย dotnet run บน host เชื่อมได้
|
||||
- "35432:5432" # เปิดให้ backend ที่รันด้วย dotnet run บน host เชื่อมได้ (host 35432 → container 5432)
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
|
|
@ -25,17 +25,22 @@ services:
|
|||
retries: 12
|
||||
|
||||
# --- MinIO (S3-compatible สำหรับไฟล์ .docx) -----------------------
|
||||
# container listen 39000/39001 เท่ากับ host ตรงๆ (ไม่ map ข้าม port) — map ข้ามแล้ว
|
||||
# console จะ redirect/-เชื่อม server ผิด port (login error / เด้งไป :9001 ตาย)
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
command: server /data --console-address ":9001"
|
||||
command: server /data --address ":39000" --console-address ":39001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
||||
# ให้ healthcheck (mc ready) เรียกผ่าน alias "local" ได้
|
||||
MC_HOST_local: http://${MINIO_ROOT_USER}:${MINIO_ROOT_PASSWORD}@localhost:9000
|
||||
MC_HOST_local: http://${MINIO_ROOT_USER}:${MINIO_ROOT_PASSWORD}@localhost:39000
|
||||
# URL ภายนอกที่ browser เห็น — ตรงกับ port จริงที่ listen จึงใช้ได้ทั้งใน/นอก container
|
||||
MINIO_BROWSER_REDIRECT_URL: http://localhost:39001
|
||||
MINIO_SERVER_URL: http://localhost:39000
|
||||
ports:
|
||||
- "9000:9000" # S3 API
|
||||
- "9001:9001" # MinIO console
|
||||
- "39000:39000" # S3 API
|
||||
- "39001:39001" # MinIO console
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
healthcheck:
|
||||
|
|
@ -58,7 +63,7 @@ services:
|
|||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
set -e;
|
||||
mc alias set local http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD;
|
||||
mc alias set local http://minio:39000 $$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;
|
||||
|
|
@ -89,7 +94,7 @@ services:
|
|||
- ${HOME}/.office-addin-dev-certs:/certs:ro
|
||||
|
||||
# --- Backend API (ยังไม่เปิดใช้ — รอ Phase 2 สร้าง Dockerfile) -----
|
||||
# รันฝั่ง host ด้วย `dotnet run` ได้เลย โดยชี้ config ไปที่ localhost:5432 / localhost:9000
|
||||
# รันฝั่ง host ด้วย `dotnet run` ได้เลย โดยชี้ config ไปที่ localhost:5432 / localhost:39000
|
||||
# หรือรันใน network นี้: docker compose --profile api up -d --build
|
||||
api:
|
||||
build:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue