andreped commited on
Commit
63c9dcd
·
1 Parent(s): 53450c2

Tried to fix Dockerfile - Docker secrets not provided

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -7,25 +7,31 @@ ENV PYTHONFAULTHANDLER=1 \
7
  POETRY_VERSION=1.5.1 \
8
  PIP_NO_CACHE_DIR=1
9
 
10
- WORKDIR /app
11
-
12
  RUN apt-get update && apt-get install -y \
13
  build-essential \
14
  curl \
15
  software-properties-common \
16
- && rm -rf /var/lib/apt/lists/* \
17
- && pip install "poetry==$POETRY_VERSION"
 
 
18
 
19
- RUN pip install -r requirements.txt
 
20
 
 
 
 
21
 
22
- FROM python:3.10-slim
 
23
 
24
- WORKDIR /app
25
 
26
- COPY --from=builder /app /app
27
 
28
- COPY /knowledge_gpt ./knowledge_gpt
 
29
 
30
  ENV PATH="/app/.venv/bin:$PATH"
31
 
 
7
  POETRY_VERSION=1.5.1 \
8
  PIP_NO_CACHE_DIR=1
9
 
 
 
10
  RUN apt-get update && apt-get install -y \
11
  build-essential \
12
  curl \
13
  software-properties-common \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Set up a new user named "user" with user ID 1000
17
+ RUN useradd -m -u 1000 user
18
 
19
+ # Switch to the "user" user
20
+ USER user
21
 
22
+ # Set home to the user's home directory
23
+ ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
 
26
+ # Set the working directory to the user's home directory
27
+ WORKDIR $HOME/app
28
 
29
+ COPY . $HOME/app
30
 
31
+ RUN python3 -m pip install -r requirements.txt
32
 
33
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
34
+ COPY --chown=user . $HOME/app
35
 
36
  ENV PATH="/app/.venv/bin:$PATH"
37