File size: 840 Bytes
d27ba95 832f651 d27ba95 832f651 d27ba95 832f651 200038f 832f651 35d171c d804cb4 f6ac2cb 35d171c f6ac2cb d27ba95 | 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 | FROM python:3.9
# Install curl for testing
RUN apt-get update && apt-get install -y curl
# Set up user
RUN useradd -m -u 1000 user
USER user
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . .
ENV PATH="/home/user/.local/bin:$PATH"
# Test connectivity (this will run as the non-root user)
RUN curl -v https://api.telegram.org || echo "Connectivity test failed, but continuing build"
# RUN curl -v https://149.154.167.220 || echo "Connectivity test failed, but continuing build"
RUN ping -c 4 8.8.8.8 || echo "Ping failed, but continuing"
RUN nslookup api.telegram.org || echo "DNS lookup failed, but continuing"
# RUN nslookup 149.154.167.220 || echo "DNS lookup failed, but continuing"
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |