- Add Dockerfile with vim, Korean locale, visual mode disabled - Add docker-compose.yml with build/push support for reg.firstgarden.co.kr - Add docker-entrypoint.sh for multi-service support - Add .dockerignore - Update README.md with Docker deployment guide - Consolidate SERVICE_KEY into DATA_API_SERVICE_KEY
53 lines
1.6 KiB
Bash
53 lines
1.6 KiB
Bash
#!/bin/bash
|
|
# ###################################################################
|
|
# docker-entrypoint.sh - FGTools 컨테이너 시작 스크립트
|
|
# ###################################################################
|
|
|
|
set -e
|
|
|
|
# PYTHONPATH 설정
|
|
export PYTHONPATH=/app:$PYTHONPATH
|
|
|
|
# 서비스별 실행
|
|
case "$1" in
|
|
dashboard)
|
|
echo "[FGTools] Starting Dashboard API on port ${FLASK_PORT:-5000}..."
|
|
exec gunicorn \
|
|
--bind 0.0.0.0:${FLASK_PORT:-5000} \
|
|
--workers ${GUNICORN_WORKERS:-2} \
|
|
--timeout 120 \
|
|
--access-logfile - \
|
|
--error-logfile - \
|
|
"apps.dashboard.app:create_app()"
|
|
;;
|
|
weather)
|
|
echo "[FGTools] Starting Weather API on port ${FLASK_PORT:-5001}..."
|
|
exec gunicorn \
|
|
--bind 0.0.0.0:${FLASK_PORT:-5001} \
|
|
--workers ${GUNICORN_WORKERS:-2} \
|
|
--timeout 120 \
|
|
--access-logfile - \
|
|
--error-logfile - \
|
|
"apps.weather_api.app:create_app()"
|
|
;;
|
|
webhook)
|
|
echo "[FGTools] Starting Webhook Server on port ${FLASK_PORT:-5002}..."
|
|
exec gunicorn \
|
|
--bind 0.0.0.0:${FLASK_PORT:-5002} \
|
|
--workers ${GUNICORN_WORKERS:-2} \
|
|
--timeout 120 \
|
|
--access-logfile - \
|
|
--error-logfile - \
|
|
"apps.webhook.app:create_app()"
|
|
;;
|
|
shell)
|
|
echo "[FGTools] Starting interactive shell..."
|
|
exec /bin/bash
|
|
;;
|
|
*)
|
|
echo "[FGTools] Unknown service: $1"
|
|
echo "Available services: dashboard, weather, webhook, shell"
|
|
exit 1
|
|
;;
|
|
esac
|