File size: 1,019 Bytes
8666ff1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Simplified Dockerfile for troubleshooting
FROM ghcr.io/gdtiti/flow2api:latest

# Fix all permissions first

USER root
RUN cd /app && \
    mkdir -p data logs config && \
    touch logs.txt && \
    chmod -R 777 /app && \
    echo "All permissions set to 777 for debugging"

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV FLOW2API_HOST=0.0.0.0
ENV FLOW2API_PORT=7860
ENV FLOW2API_DEBUG_ENABLED=false

# Switch to root user for maximum compatibility

USER root

# Expose port
EXPOSE 7860

# Health check with long startup time
HEALTHCHECK --interval=30s --timeout=10s --start-period=180s --retries=3 \
    CMD python -c "import socket; s=socket.socket(); s.connect(('localhost', 7860)); s.close()" || exit 1

# Start with debugging script if main app fails
COPY start_simple.py /app/start_simple.py
RUN chmod +x /app/start_simple.py

# Try main app first, fallback to simple version
CMD ["/bin/bash", "-c", "python main.py || python start_simple.py"]