Update dockerfile with gunicorn for prod
This commit is contained in:
@@ -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"]
|
||||
|
||||
8
docker-entrypoint.sh
Normal file
8
docker-entrypoint.sh
Normal file
@@ -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 -
|
||||
@@ -5,3 +5,4 @@ Flask-WTF>=1.2.1
|
||||
pytest>=7.4
|
||||
requests>=2.31
|
||||
boto3>=1.34
|
||||
gunicorn>=21.2.0
|
||||
|
||||
Reference in New Issue
Block a user