test2 / Dockerfile
dynstat's picture
Update Dockerfile
35d171c verified
Raw History Blame Contribute Delete
840 Bytes
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"]