docekr
This commit is contained in:
+13
-3
@@ -1,11 +1,21 @@
|
|||||||
FROM python:3.14-alpine
|
FROM python:3.14-alpine
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||||
|
PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN mkdir -p /data
|
RUN mkdir -p /data
|
||||||
|
|
||||||
EXPOSE 8000
|
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"]
|
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:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
ports:
|
ports:
|
||||||
- "${APP_HOST_PORT:-8000}:${APP_PORT:-8000}"
|
- "${APP_HOST_PORT:-8000}:${APP_PORT:-8000}"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
init: true
|
||||||
|
stop_grace_period: 30s
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
|
||||||
- ./instance:/app/instance
|
- ./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>=3.1.1
|
||||||
Flask-SQLAlchemy==3.1.1
|
Flask-SQLAlchemy>=3.1.1
|
||||||
Flask-Login==0.6.3
|
Flask-Login>=0.6.3
|
||||||
Flask-SocketIO==5.5.1
|
Flask-SocketIO>=5.5.1
|
||||||
simple-websocket==1.1.0
|
simple-websocket>=1.1.0
|
||||||
requests==2.32.4
|
requests>=2.32.4
|
||||||
gunicorn==23.0.0
|
gunicorn>=23.0.0
|
||||||
pytest==8.4.1
|
pytest>=8.4.1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user