Muhammad541 commited on
Commit
3bf1cd6
·
verified ·
1 Parent(s): d8ecb62

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
-
5
  RUN useradd -m -u 1000 appuser
6
  RUN mkdir -p /app/saved_models && chown -R appuser:appuser /app
7
-
8
  COPY requirements.txt .
9
 
10
  RUN apt-get update && apt-get install -y \
@@ -12,16 +10,19 @@ RUN apt-get update && apt-get install -y \
12
  libatlas-base-dev \
13
  gfortran \
14
  swig \
 
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
 
 
 
 
 
 
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
  COPY . .
20
-
21
- RUN chown -R appuser:appuser /app
22
-
23
  USER appuser
24
-
25
- EXPOSE 7860
26
-
27
  CMD ["python", "app.py"]
 
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /app
 
4
  RUN useradd -m -u 1000 appuser
5
  RUN mkdir -p /app/saved_models && chown -R appuser:appuser /app
 
6
  COPY requirements.txt .
7
 
8
  RUN apt-get update && apt-get install -y \
 
10
  libatlas-base-dev \
11
  gfortran \
12
  swig \
13
+ git \
14
+ cmake \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ RUN git clone https://github.com/facebookresearch/faiss.git /faiss \
18
+ && cd /faiss \
19
+ && mkdir build && cd build \
20
+ && cmake -DFAISS_ENABLE_GPU=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local .. \
21
+ && make -j$(nproc) \
22
+ && make install
23
+
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
  COPY . .
 
 
 
27
  USER appuser
 
 
 
28
  CMD ["python", "app.py"]