Skip to content

Commit

Permalink
setup permission
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Jan 6, 2024
1 parent 073bc44 commit 9ca8b26
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ FROM deepset/haystack:base-cpu-v1.23.0
COPY requirements.txt .
RUN pip install -r requirements.txt

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# copy only the application files in /app
# Streamlit does not allow running an app from the root directory
COPY Rock_fact_checker.py app/
COPY pages app/pages
COPY app_utils app/app_utils
COPY data app/data
COPY --chown=user Rock_fact_checker.py $HOME/app/
COPY --chown=user pages $HOME/app/pages
COPY --chown=user app_utils $HOME/app/app_utils
COPY --chown=user data $HOME/app/data

WORKDIR app
WORKDIR $HOME/app

EXPOSE 8501

Expand Down

0 comments on commit 9ca8b26

Please sign in to comment.