Spaces:
Runtime error
Runtime error
created user in dockerfile
Browse files- Dockerfile +14 -5
Dockerfile
CHANGED
|
@@ -12,13 +12,22 @@ ENV POETRY_NO_INTERACTION=1 \
|
|
| 12 |
POETRY_VIRTUALENVS_CREATE=1 \
|
| 13 |
POETRY_CACHE_DIR=/tmp/poetry_cache
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Set the working directory inside the container
|
| 16 |
-
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
COPY .chainlit ./
|
| 21 |
-
COPY .chainlit/config.toml .chainlit/config.toml
|
| 22 |
|
| 23 |
# Install project dependencies using Poetry
|
| 24 |
RUN poetry install --without dev
|
|
|
|
| 12 |
POETRY_VIRTUALENVS_CREATE=1 \
|
| 13 |
POETRY_CACHE_DIR=/tmp/poetry_cache
|
| 14 |
|
| 15 |
+
# Create a user
|
| 16 |
+
RUN useradd -m -u 1000 user
|
| 17 |
+
USER user
|
| 18 |
+
ENV HOME=/home/user \
|
| 19 |
+
PATH=/home/user/.local/bin:$PATH
|
| 20 |
+
|
| 21 |
# Set the working directory inside the container
|
| 22 |
+
WORKDIR $HOME/app
|
| 23 |
+
|
| 24 |
+
COPY --chown=user pyproject.toml poetry.lock ./
|
| 25 |
+
COPY --chown=user chainlit.md app.py prompts.py ./
|
| 26 |
+
COPY --chown=user .chainlit ./
|
| 27 |
+
COPY --chown=user .chainlit/config.toml .chainlit/config.toml
|
| 28 |
|
| 29 |
+
# Change the permissions of the working directory "read and write for user, read for others"
|
| 30 |
+
RUN chmod -R 755 $HOME/app
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Install project dependencies using Poetry
|
| 33 |
RUN poetry install --without dev
|