Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
@@ -1,8 +1,17 @@
|
|
1 |
# Use Python 3.10 as base image
|
2 |
FROM python:3.10-slim
|
|
|
|
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Install system dependencies and uv
|
8 |
RUN apt-get update && apt-get install -y \
|
@@ -19,9 +28,8 @@ COPY pyproject.toml .
|
|
19 |
# Install Python dependencies using uv
|
20 |
RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
|
21 |
|
22 |
-
# Copy the
|
23 |
-
COPY .
|
24 |
-
|
25 |
# Create directories for uploads and embeddings if they don't exist
|
26 |
RUN mkdir -p uploads embeddings
|
27 |
|
|
|
1 |
# Use Python 3.10 as base image
|
2 |
FROM python:3.10-slim
|
3 |
+
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
|
6 |
+
# Switch to the "user" user
|
7 |
+
USER user
|
8 |
+
|
9 |
+
# Set home to the user's home directory
|
10 |
+
ENV HOME=/home/user \
|
11 |
+
PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
+
# Set the working directory to the user's home directory
|
14 |
+
WORKDIR $HOME/app
|
15 |
|
16 |
# Install system dependencies and uv
|
17 |
RUN apt-get update && apt-get install -y \
|
|
|
28 |
# Install Python dependencies using uv
|
29 |
RUN . ~/.bashrc && uv pip install -r pyproject.toml --system
|
30 |
|
31 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
32 |
+
COPY --chown=user . $HOME/app
|
|
|
33 |
# Create directories for uploads and embeddings if they don't exist
|
34 |
RUN mkdir -p uploads embeddings
|
35 |
|