Spaces:
Build error
Build error
lucianotonet
commited on
Commit
•
54a4c87
1
Parent(s):
f59560c
Update Dockerfile
Browse files- Dockerfile +24 -17
Dockerfile
CHANGED
@@ -1,30 +1,37 @@
|
|
1 |
-
FROM
|
|
|
2 |
ENV DEBIAN_FRONTEND noninteractive
|
3 |
ENV CMDARGS --listen
|
4 |
|
|
|
5 |
RUN apt-get update -y && \
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
RUN pip install
|
12 |
-
rm -f /tmp/requirements_docker.txt
|
13 |
|
14 |
-
|
15 |
RUN curl -fsL -o /usr/local/lib/python3.10/dist-packages/gradio/frpc_linux_amd64_v0.2 https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 && \
|
16 |
-
|
17 |
|
|
|
18 |
RUN adduser --disabled-password --gecos '' user && \
|
19 |
-
|
20 |
-
|
21 |
-
COPY --from=build /entrypoint.sh /content/
|
22 |
RUN chown -R user:user /content
|
23 |
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
|
|
|
|
1 |
+
FROM nvidia/cuda:12.3.1-base-ubuntu22.04
|
2 |
+
|
3 |
ENV DEBIAN_FRONTEND noninteractive
|
4 |
ENV CMDARGS --listen
|
5 |
|
6 |
+
# Instalar dependências do sistema
|
7 |
RUN apt-get update -y && \
|
8 |
+
apt-get install -y curl libgl1 libglib2.0-0 git python3-pip && \
|
9 |
+
apt-get clean && \
|
10 |
+
rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Criar diretório de trabalho
|
13 |
+
WORKDIR /code
|
14 |
|
15 |
+
# Instalar pygit2
|
16 |
+
RUN pip install pygit2==1.12.2
|
|
|
17 |
|
18 |
+
# Configurar Gradio
|
19 |
RUN curl -fsL -o /usr/local/lib/python3.10/dist-packages/gradio/frpc_linux_amd64_v0.2 https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 && \
|
20 |
+
chmod +x /usr/local/lib/python3.10/dist-packages/gradio/frpc_linux_amd64_v0.2
|
21 |
|
22 |
+
# Configurar diretórios e permissões
|
23 |
RUN adduser --disabled-password --gecos '' user && \
|
24 |
+
mkdir -p /content/app /content/data
|
|
|
|
|
25 |
RUN chown -R user:user /content
|
26 |
|
27 |
+
# Copiar código do aplicativo
|
28 |
+
COPY . /code/
|
29 |
+
|
30 |
+
# Expor porta 7860
|
31 |
+
EXPOSE 7860
|
32 |
|
33 |
+
# Executar como usuário não root
|
34 |
+
USER user
|
35 |
|
36 |
+
# Comando de inicialização
|
37 |
+
CMD ["python", "entry_with_update.py", "--preset", "realistic", "--share", "--always-high-vram"]
|