| |
| |
|
|
| FROM python |
|
|
| RUN useradd -m -u 1000 user |
| |
|
|
| |
| |
|
|
| 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 |
|
|
|
|
|
|
|
|
| |
|
|
| |
| |
|
|
| 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"] |
| |
| |