carlosdimare commited on
Commit
22948bf
verified
1 Parent(s): 786d41c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,19 +1,20 @@
1
  FROM ollama/ollama:latest
2
 
3
- # Instalar Python y herramientas necesarias
 
 
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 no root
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 y activarlo
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
- # Dar permisos de ejecuci贸n al entrypoint
25
  RUN chmod +x entrypoint.sh
26
 
27
- # Exponer puerto
 
 
28
  EXPOSE 7860
29
 
30
- # Iniciar todo
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"]