Spaces:
Paused

studydocker / Dockerfile
mingli2038's picture
add entrypoint11
aa7fee1
Raw History Blame Contribute Delete
1.16 kB
# 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.12
# 安装基础工具
RUN apt-get update && apt-get install -y --no-install-recommends \
iproute2 iputils-ping net-tools iputils-tracepath dnsutils \
netcat-openbsd openssh-client fdisk nano vim kmod dropbear tini && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# 安装 Caddy 并写入 Caddyfile
RUN curl -fsSL "https://caddyserver.com/api/download?os=linux&arch=amd64" -o /usr/local/bin/caddy && \
chmod +x /usr/local/bin/caddy && \
mkdir -p /etc/caddy /var/log/caddy /var/www && \
useradd -m -u 1000 user && \
chown -R 1000:1000 /var/www /etc/caddy /var/log/caddy && \
echo "<h1>Welcome to Caddy!</h1>" > /var/www/index.html
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# 设置工作目录
WORKDIR /app
COPY --chown=user . /app
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "--", "/app/entrypoint.sh"]
EXPOSE 4567
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]