Spaces:
Sleeping
Sleeping
Commit
β’
6fd68d7
1
Parent(s):
8c4896e
Docker working locally
Browse files- Dockerfile +21 -8
- data/embeddings/{.lock β .lock.old} +0 -0
Dockerfile
CHANGED
@@ -1,15 +1,28 @@
|
|
1 |
FROM python:3.9
|
|
|
|
|
2 |
RUN useradd -m -u 1000 user
|
3 |
-
|
|
|
4 |
ENV HOME=/home/user \
|
5 |
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
6 |
WORKDIR $HOME/app
|
7 |
-
|
8 |
-
|
9 |
-
COPY ./
|
10 |
-
RUN chmod -R 777 ~/app/data
|
11 |
-
RUN chown -R user ~/app/data
|
12 |
RUN pip install -r requirements.txt
|
13 |
-
COPY . .
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
+
|
3 |
+
# Create a non-root user
|
4 |
RUN useradd -m -u 1000 user
|
5 |
+
|
6 |
+
# Set the environment variables
|
7 |
ENV HOME=/home/user \
|
8 |
PATH=/home/user/.local/bin:$PATH
|
9 |
+
|
10 |
+
# Set the working directory
|
11 |
WORKDIR $HOME/app
|
12 |
+
|
13 |
+
# Copy the requirements and install dependencies
|
14 |
+
COPY --chown=user:user ./requirements.txt $HOME/app/requirements.txt
|
|
|
|
|
15 |
RUN pip install -r requirements.txt
|
|
|
16 |
|
17 |
+
# Copy the entire project and take ownership
|
18 |
+
COPY --chown=user:user . $HOME/app
|
19 |
+
|
20 |
+
# Create and adjust permissions for data directory
|
21 |
+
RUN mkdir -p $HOME/app/data/embeddings && \
|
22 |
+
chown -R user:user $HOME/app/data
|
23 |
+
|
24 |
+
# Use the non-root user to run the app
|
25 |
+
USER user
|
26 |
+
|
27 |
+
# Command to run the application
|
28 |
+
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|
data/embeddings/{.lock β .lock.old}
RENAMED
File without changes
|