Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
|
@@ -1,19 +1,20 @@
|
|
| 1 |
FROM ollama/ollama:latest
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && \
|
| 5 |
apt-get install -y python3 python3-venv python3-pip curl git && \
|
| 6 |
rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
# Crear usuario
|
| 9 |
RUN useradd -m -s /bin/bash user
|
| 10 |
-
USER user
|
| 11 |
-
WORKDIR /home/user
|
| 12 |
|
| 13 |
# Copiar archivos
|
| 14 |
-
COPY --chown=user:user .
|
|
|
|
| 15 |
|
| 16 |
-
# Crear entorno virtual
|
| 17 |
RUN python3 -m venv venv
|
| 18 |
ENV PATH="/home/user/venv/bin:$PATH"
|
| 19 |
|
|
@@ -21,11 +22,12 @@ ENV PATH="/home/user/venv/bin:$PATH"
|
|
| 21 |
RUN pip install --upgrade pip
|
| 22 |
RUN pip install -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 25 |
RUN chmod +x entrypoint.sh
|
| 26 |
|
| 27 |
-
#
|
|
|
|
|
|
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
-
|
| 31 |
-
ENTRYPOINT ["bash", "entrypoint.sh"]
|
|
|
|
| 1 |
FROM ollama/ollama:latest
|
| 2 |
|
| 3 |
+
USER root
|
| 4 |
+
|
| 5 |
+
# Instalar Python y herramientas
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y python3 python3-venv python3-pip curl git && \
|
| 8 |
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Crear usuario
|
| 11 |
RUN useradd -m -s /bin/bash user
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Copiar archivos
|
| 14 |
+
COPY --chown=user:user . /home/user/
|
| 15 |
+
WORKDIR /home/user
|
| 16 |
|
| 17 |
+
# Crear entorno virtual
|
| 18 |
RUN python3 -m venv venv
|
| 19 |
ENV PATH="/home/user/venv/bin:$PATH"
|
| 20 |
|
|
|
|
| 22 |
RUN pip install --upgrade pip
|
| 23 |
RUN pip install -r requirements.txt
|
| 24 |
|
| 25 |
+
# Asegurar permisos de ejecuci贸n
|
| 26 |
RUN chmod +x entrypoint.sh
|
| 27 |
|
| 28 |
+
# Cambiar a usuario no root
|
| 29 |
+
USER user
|
| 30 |
+
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
+
ENTRYPOINT ["bash", "./entrypoint.sh"]
|
|
|