Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
@@ -6,26 +6,32 @@ ENV PYTHONUNBUFFERED=1
|
|
6 |
|
7 |
# Install Python and dependencies
|
8 |
RUN apt-get update && apt-get install -y \
|
9 |
-
python3 python3-pip ffmpeg curl git wget \
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
-
#
|
15 |
-
RUN
|
|
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
|
|
|
|
|
20 |
COPY requirements.txt .
|
21 |
RUN pip install -r requirements.txt
|
22 |
-
|
23 |
COPY . .
|
24 |
|
25 |
-
#
|
26 |
RUN wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
|
27 |
|
|
|
28 |
EXPOSE 8501
|
29 |
|
30 |
-
# Start Ollama and
|
31 |
CMD bash -c "ollama serve & sleep 5 && ollama pull gemma3 && streamlit run streamlit_app.py --server.port=8501 --server.address=0.0.0.0"
|
|
|
6 |
|
7 |
# Install Python and dependencies
|
8 |
RUN apt-get update && apt-get install -y \
|
9 |
+
python3 python3-pip ffmpeg curl git wget sudo \
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
+
# Create a non-root user
|
13 |
+
RUN useradd -ms /bin/bash ollama
|
14 |
+
USER ollama
|
15 |
+
WORKDIR /home/ollama
|
16 |
|
17 |
+
# Set up Python
|
18 |
+
RUN ln -s /usr/bin/python3 /usr/bin/python
|
19 |
+
RUN pip install --upgrade pip
|
20 |
|
21 |
+
# Install Ollama (under user home, not root)
|
22 |
+
RUN curl -fsSL https://ollama.com/install.sh | sh
|
23 |
|
24 |
+
# Set up app directory under user space
|
25 |
+
WORKDIR /home/ollama/app
|
26 |
COPY requirements.txt .
|
27 |
RUN pip install -r requirements.txt
|
|
|
28 |
COPY . .
|
29 |
|
30 |
+
# Download Hugging Face interface file
|
31 |
RUN wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
|
32 |
|
33 |
+
# Expose port for Streamlit
|
34 |
EXPOSE 8501
|
35 |
|
36 |
+
# Start Ollama and the app
|
37 |
CMD bash -c "ollama serve & sleep 5 && ollama pull gemma3 && streamlit run streamlit_app.py --server.port=8501 --server.address=0.0.0.0"
|