Files
calorie_tracker/calorie_tracker_app/entrypoint.sh
Jp 1dcb871114
Some checks failed
Build and Push Docker Image (Gitea) / build-and-push (push) Has been cancelled
fix(docker): correct port mapping and improve container startup
- Fix port mapping from 5001:5001 to 5001:5000 to match internal application port
- Add entrypoint script for proper database initialization and seeding
- Set PORT environment variable to 5000 for consistency
- Update Dockerfile to use entrypoint script with proper line ending handling
2026-01-30 22:24:17 +08:00

19 lines
395 B
Bash

#!/bin/sh
# Exit immediately if a command exits with a non-zero status
set -e
# Initialize database
echo "Initializing database..."
flask init-db
# Seed database
echo "Seeding database..."
flask seed-db
# Start Gunicorn
# Use PORT environment variable if set, otherwise default to 5000
PORT=${PORT:-5000}
echo "Starting Gunicorn on port $PORT..."
exec gunicorn -w 4 -b 0.0.0.0:$PORT app:app