Files
sriphat-dataplatform/03-apiservice/docker-compose.yml
jigoong a587be08bd feat: MinIO integration — bucket finance, API service upload, Nginx routing
- 01-infra/nginx-configs: add MinIO /minio/ and /minio-console/ location blocks
  (port 9000 S3 API, port 9001 Console UI, path stripping via rewrite)
- 03-apiservice: integrate MinIO minio-python SDK for file upload
  - requirements.txt: add minio==7.2.11
  - app/core/config.py: add MINIO_ENDPOINT, ACCESS_KEY, SECRET_KEY, BUCKET_FINANCE, USE_SSL
  - app/services/minio_client.py: new — upload_file(), get_presigned_url(), delete_file()
  - app/routes/pages.py: replace local /data/uploads/ write with MinIO upload to finance bucket
  - docker-compose.yml: pass MinIO env vars to container
  - .env.example: document MinIO vars
- 07-minio/.env.example: add MINIO_SVC_ACCESS_KEY/SECRET_KEY section
- 07-minio/README.md: add Python minio SDK and Airflow DAG usage guide
- CLAUDE.md: project context (servers, SSH, paths, service distribution)
- document-obsidiant/: initial Obsidian docs for all services
2026-05-20 17:42:39 +07:00

61 lines
1.8 KiB
YAML

x-common-configs: &common-config
extra_hosts:
- "dev.sriphat.com:192.168.100.9"
pull_policy: ${DOCKER_PULL_POLICY:-missing}
services:
apiservice:
#build: .
image: 03-apiservice-apiservice:latest
container_name: apiservice
env_file:
- .env
environment:
- TZ=${TZ:-Asia/Bangkok}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_SSLMODE=${DB_SSLMODE}
- ROOT_PATH=${ROOT_PATH}
- APP_NAME=${APP_NAME}
- ADMIN_SECRET_KEY=${ADMIN_SECRET_KEY}
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- API_KEY_ENC_SECRET=${ADMIN_SECRET_KEY}
- DEBUG_AUTH=${DEBUG_AUTH:-false}
- KEYCLOAK_SERVER_URL=${KEYCLOAK_SERVER_URL}
- KEYCLOAK_REALM=${KEYCLOAK_REALM}
- KEYCLOAK_CLIENT_ID=${API_KEYCLOAK_CLIENT_ID}
- KEYCLOAK_CLIENT_SECRET=${API_KEYCLOAK_CLIENT_SECRET}
- KEYCLOAK_REDIRECT_URI=${API_KEYCLOAK_REDIRECT_URI}
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-192.168.100.9:9000}
- MINIO_ACCESS_KEY=${MINIO_SVC_ACCESS_KEY}
- MINIO_SECRET_KEY=${MINIO_SVC_SECRET_KEY}
- MINIO_BUCKET_FINANCE=${MINIO_BUCKET_FINANCE:-finance}
- MINIO_USE_SSL=${MINIO_USE_SSL:-false}
- LOG_LEVEL=debug
ports:
- "8040:8040"
networks:
- shared_data_network
volumes:
- ./app:/app/app
- .env:/app/.env
- ./data/uploads:/data/uploads
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8040/apiservice/docs"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# extra_hosts:
# - "dev.sriphat.com:192.168.100.9"
<<: *common-config
networks:
shared_data_network:
external: true