khronoz commited on
Commit
67ecbd1
·
unverified ·
2 Parent(s): 37b7a4a 9fc4bce

Merge pull request #7 from digitalbuiltenvironment/development

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -11
  2. backend/pyproject.toml +3 -0
Dockerfile CHANGED
@@ -1,9 +1,12 @@
1
- # Use the official Python slim image
2
- FROM python:3.11.4-slim-bullseye
3
 
4
  # Set up a new user named "user" with user ID 1000
5
  RUN useradd -m -u 1000 user
 
 
6
 
 
7
  USER user
8
 
9
  # Set home to the user's home directory and Poetry's environment variables
@@ -12,29 +15,30 @@ ENV HOME=/home/user \
12
  POETRY_NO_INTERACTION=1 \
13
  POETRY_VIRTUALENVS_IN_PROJECT=1 \
14
  POETRY_VIRTUALENVS_CREATE=1 \
15
- POETRY_CACHE_DIR=/tmp/poetry_cache
 
16
 
17
  # Set the working directory to /app
18
  WORKDIR $HOME/app
19
 
 
 
 
20
  # Install poetry
21
  RUN pip install poetry
22
 
23
  # Copy the poetry files
24
  COPY --chown=user ./backend/pyproject.toml ./backend/poetry.lock $HOME/app/
25
 
26
- # Install the dependencies
27
- RUN poetry install --without dev && \
28
- --no-root && \
29
- rm -rf /tmp/poetry_cache
30
-
31
  # Copy the rest of the files
32
  COPY --chown=user ./backend $HOME/app
33
 
34
- # Install the package
35
- RUN poetry install --without dev
 
 
36
 
37
  # Change to the package directory
38
  WORKDIR $HOME/app/backend
39
 
40
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]
 
1
+ # Use the official Python Image
2
+ FROM python:3.11.4
3
 
4
  # Set up a new user named "user" with user ID 1000
5
  RUN useradd -m -u 1000 user
6
+ # Install the dependencies
7
+ RUN apt-get update && apt-get -y install cmake protobuf-compiler libopenblas-dev liblapack-dev liblapacke-dev libeigen3-dev libboost-all-dev
8
 
9
+ # Switch to the user 'user'
10
  USER user
11
 
12
  # Set home to the user's home directory and Poetry's environment variables
 
15
  POETRY_NO_INTERACTION=1 \
16
  POETRY_VIRTUALENVS_IN_PROJECT=1 \
17
  POETRY_VIRTUALENVS_CREATE=1 \
18
+ POETRY_CACHE_DIR=/tmp/poetry_cache \
19
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS"
20
 
21
  # Set the working directory to /app
22
  WORKDIR $HOME/app
23
 
24
+ # Update pip and wheel
25
+ RUN pip install --upgrade pip setuptools wheel
26
+
27
  # Install poetry
28
  RUN pip install poetry
29
 
30
  # Copy the poetry files
31
  COPY --chown=user ./backend/pyproject.toml ./backend/poetry.lock $HOME/app/
32
 
 
 
 
 
 
33
  # Copy the rest of the files
34
  COPY --chown=user ./backend $HOME/app
35
 
36
+ # Install the dependencies
37
+ RUN poetry lock --no-update
38
+ RUN poetry install --without dev && \
39
+ rm -rf /tmp/poetry_cache
40
 
41
  # Change to the package directory
42
  WORKDIR $HOME/app/backend
43
 
44
+ CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0"]
backend/pyproject.toml CHANGED
@@ -29,6 +29,9 @@ torch = [
29
  # ]
30
  docx2txt = "^0.8"
31
 
 
 
 
32
 
33
  [build-system]
34
  requires = ["poetry-core"]
 
29
  # ]
30
  docx2txt = "^0.8"
31
 
32
+ # Dev Dependencies here
33
+ [tool.poetry.group.dev.dependencies]
34
+
35
 
36
  [build-system]
37
  requires = ["poetry-core"]