Spaces:
Sleeping
Sleeping
File size: 1,276 Bytes
7175a27 3ef791f 5ae4842 3ef791f 1073da8 3ef791f b03f7d4 3ef791f 1a32078 7175a27 b03f7d4 d23f0a1 79619e2 7175a27 3ef791f b9e4744 3ef791f 7175a27 1e1af32 094c0c8 3ef791f 1073da8 3ef791f 1073da8 e9df082 | 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.9
# 安装运行时依赖
RUN apt-get update && apt-get install -y \
gcc g++ cmake make git gnupg \
nginx \
supervisor \
curl \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# 安装 Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
RUN useradd -m -u 1000 user
RUN chown -R user:user /var/lib/nginx/ \
&& chmod -R 755 /var/lib/nginx \
&& chown -R user:user /var/log/ \
&& chmod -R 755 /var/log \
&& chown -R user:user /run/ \
&& chmod -R 755 /run
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# 复制 Nginx 配置
#COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
RUN chmod +x /app/scripts/start.sh
# 暴露端口
EXPOSE 7860
# 启动服务
#CMD ["/app/scripts/start.sh"]
#CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# 启动 Supervisor
CMD ["/usr/bin/supervisord", "-n", "-c", "/app/supervisor/supervisor.conf"]
|