zzz / Dockerfile
hern0425's picture
Upload 13 files
8666ff1 verified
# 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"]