Download Dockerfile from rhayman/db_all: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/rhayman/db_all/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/rhayman/db_all/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/rhayman/db_all/resolve/main/Dockerfile
1.25 kB
| FROM postgres:16 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # python for the FastAPI app, ssh client for the tunnel, supervisor to run | |
| # postgres + the tunnel loop + the api as one PID-1-managed process tree. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3 python3-pip \ | |
| openssh-client \ | |
| supervisor \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Key so pinggy never blocks on an interactive password prompt (there's no | |
| # TTY in a container). Accepted as an unauthenticated client key by pinggy's | |
| # free tier -- it's just there to skip the "press enter" prompt. | |
| RUN mkdir -p /root/.ssh \ | |
| && ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N "" -q | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip3 install --no-cache-dir --break-system-packages --ignore-installed -r requirements.txt | |
| COPY app/ ./app/ | |
| COPY tunnel.sh /usr/local/bin/tunnel.sh | |
| RUN chmod +x /usr/local/bin/tunnel.sh | |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| # Override these at `docker run -e ...` (don't ship real creds in the image). | |
| ENV POSTGRES_PASSWORD=changeme | |
| ENV POSTGRES_USER=postgres | |
| ENV POSTGRES_DB=postgres | |
| EXPOSE 7860 | |
| ENTRYPOINT ["/usr/bin/supervisord"] | |
| CMD ["-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | |