xtools / Dockerfile
bitterapricot's picture
add files.
5757aad
Raw
History Blame Contribute Delete
1.25 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.9
# ��װ����ʱ����
RUN apt-get update && apt-get install -y \
gcc g++ cmake make 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"]