diff --git a/Dockerfile b/Dockerfile index dec63e2..b18c77c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . +# Make entrypoint executable +RUN chmod +x docker-entrypoint.sh + # Create data directory and set permissions RUN mkdir -p /app/data \ && useradd -m -u 1000 myfsio \ @@ -31,4 +34,4 @@ ENV APP_HOST=0.0.0.0 \ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD python -c "import requests; requests.get('http://localhost:5000/healthz', timeout=2)" -CMD ["python", "run.py", "--mode", "both"] +CMD ["./docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..6fbaf2e --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +# Start API server in background +gunicorn "app:create_api_app()" --bind 0.0.0.0:5000 --workers 4 --access-logfile - & + +# Start UI server in foreground +gunicorn "app:create_ui_app()" --bind 0.0.0.0:5100 --workers 4 --access-logfile - diff --git a/requirements.txt b/requirements.txt index 356c1f9..7697a50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Flask-WTF>=1.2.1 pytest>=7.4 requests>=2.31 boto3>=1.34 +gunicorn>=21.2.0