Initial commit
This commit is contained in:
40
docker/dockerfile
Normal file
40
docker/dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
android-tools-adb \
|
||||
sqlite3 \
|
||||
dos2unix \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements and install
|
||||
COPY src/requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt gunicorn
|
||||
|
||||
# Create directories for data persistence
|
||||
RUN mkdir -p /app/data /app/uploads /app/logs /app/static /app/templates /app/src
|
||||
|
||||
# Copy application source and static assets
|
||||
COPY src/ /app/src/
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 5000
|
||||
EXPOSE 5037
|
||||
|
||||
# Volume for persistent data
|
||||
VOLUME ["/app/data", "/app/uploads", "/app/logs"]
|
||||
|
||||
# Set environment variables
|
||||
ENV FLASK_APP=src/app.py
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Add healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:5000/health || exit 1
|
||||
|
||||
# Run the application with gunicorn for better signal handling
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "2", "--timeout", "120", "--graceful-timeout", "30", "--preload", "src.wsgi:app"]
|
||||
Reference in New Issue
Block a user