File size: 1,549 Bytes
475f359 8dc2d64 475f359 a926cc8 bd3998a cde38ea 5afee43 cde38ea 5afee43 cde38ea a926cc8 daa94e9 84f18bd 031b83a 7277b12 031b83a 7277b12 031b83a 36a06ec 031b83a 475f359 36a06ec 1f22f9b 475f359 031b83a daa94e9 73c42dc 031b83a |
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.13
RUN useradd -m -u 1000 user
#run chattr -i /etc/resolv.conf
#RUN mkdir /etc/dhcp/
#RUN echo 'supersede domain-name-servers 8.8.8.8;' > /etc/dhcp/dhclient.conf
# RUN apt-get update
# RUN apt-get install -y -q dnsmasq
# RUN echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf
# RUN echo 'resolv-file=/etc/resolv.dnsmasq.conf' >> /etc/dnsmasq.conf
# RUN echo 'conf-dir=/etc/dnsmasq.d' >> /etc/dnsmasq.conf
# RUN echo 'user=root' >> /etc/dnsmasq.conf
# RUN echo 'nameserver 8.8.8.8' >> /etc/resolv.dnsmasq.conf
# RUN echo 'nameserver 8.8.4.4' >> /etc/resolv.dnsmasq.conf
# RUN echo 'address="/mydomain/127.0.6.1"' >> /etc/dnsmasq.d/0hosts
# RUN service dnsmasq start
# expose 53
#RUN echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
# RUN ls -la /etc/resolv.conf
# COPY resolv.conf /etc/resolv.conf
# RUN ls -la /etc/resolv.conf
# RUN cat /etc/resolv.conf
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
#CMD echo sudo "nameserver 8.8.8.8" > /etc/resolv.conf && uvicorn app:app --host 0.0.0.0 --port 7860
#echo "nameserver XX.XX.1.1" > /etc/resolv.conf
# CMD ["sh", "-c", "echo 'nameserver 8.8.8.8' > /etc/resolv.conf && exec uvicorn app:app --host 0.0.0.0 --port 7860"] |