docekr
This commit is contained in:
+13
-3
@@ -1,11 +1,21 @@
|
||||
FROM python:3.14-alpine
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p /data
|
||||
|
||||
EXPOSE 8000
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD sh -c 'curl -f http://localhost:${APP_PORT:-8000}/health || exit 1'
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
||||
CMD sh -c 'curl -f http://localhost:${APP_PORT:-8000}/health || exit 1'
|
||||
|
||||
CMD ["sh", "-c", "gunicorn --worker-class gthread --workers ${GUNICORN_WORKERS:-1} --threads ${GUNICORN_THREADS:-8} --timeout ${GUNICORN_TIMEOUT:-0} --bind 0.0.0.0:${APP_PORT:-8000} wsgi:app"]
|
||||
|
||||
|
||||
+17
-3
@@ -1,12 +1,26 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "${APP_HOST_PORT:-8000}:${APP_PORT:-8000}"
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
stop_grace_period: 30s
|
||||
volumes:
|
||||
- .:/app
|
||||
- ./instance:/app/instance
|
||||
- ./data:/app/data
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- >
|
||||
python -c "import os, urllib.request;
|
||||
urllib.request.urlopen(
|
||||
'http://127.0.0.1:' + os.getenv('APP_PORT', '8000') + '/health',
|
||||
timeout=5)"
|
||||
interval: 30s
|
||||
timeout: 6s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
|
||||
+8
-8
@@ -1,9 +1,9 @@
|
||||
Flask==3.1.1
|
||||
Flask-SQLAlchemy==3.1.1
|
||||
Flask-Login==0.6.3
|
||||
Flask-SocketIO==5.5.1
|
||||
simple-websocket==1.1.0
|
||||
requests==2.32.4
|
||||
gunicorn==23.0.0
|
||||
pytest==8.4.1
|
||||
Flask>=3.1.1
|
||||
Flask-SQLAlchemy>=3.1.1
|
||||
Flask-Login>=0.6.3
|
||||
Flask-SocketIO>=5.5.1
|
||||
simple-websocket>=1.1.0
|
||||
requests>=2.32.4
|
||||
gunicorn>=23.0.0
|
||||
pytest>=8.4.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user