Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +35 -12
Dockerfile
CHANGED
@@ -1,15 +1,38 @@
|
|
1 |
-
FROM python:3.10-slim-buster
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
RUN
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
|
|
|
|
13 |
COPY . .
|
|
|
|
|
14 |
RUN chmod -R 777 translations
|
15 |
-
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim-buster
|
2 |
+
|
3 |
+
# Set the working directory
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Copy requirements file
|
7 |
+
COPY requirements.txt requirements.txt
|
8 |
+
|
9 |
+
# Create a virtual environment
|
10 |
+
RUN python -m venv venv
|
11 |
+
|
12 |
+
# Set the PATH to use the virtual environment
|
13 |
+
ENV PATH="/app/venv/bin:$PATH"
|
14 |
+
|
15 |
+
# Update package list and install necessary packages in a single step
|
16 |
+
RUN apt-get update && apt-get install -y \
|
17 |
+
curl \
|
18 |
+
build-essential \
|
19 |
+
libffi-dev \
|
20 |
+
cmake \
|
21 |
+
libcurl4-openssl-dev && \
|
22 |
+
apt-get clean
|
23 |
+
|
24 |
+
# Upgrade pip and install dependencies
|
25 |
+
RUN python -m pip install --upgrade pip
|
26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
27 |
+
|
28 |
+
# Install additional software
|
29 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
30 |
+
|
31 |
+
# Copy the entire application
|
32 |
COPY . .
|
33 |
+
|
34 |
+
# Set proper permissions for the translations directory
|
35 |
RUN chmod -R 777 translations
|
36 |
+
|
37 |
+
# Define the command to run the application
|
38 |
+
CMD ["python", "./run.py"]
|