Synced repo using 'sync_with_huggingface' Github Action
Browse files- Dockerfile +28 -0
Dockerfile
CHANGED
|
@@ -68,4 +68,32 @@ RUN apt-get update && apt-get install -y \
|
|
| 68 |
poppler-utils
|
| 69 |
|
| 70 |
# Hugging Face Hub Settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"]
|
|
|
|
| 68 |
poppler-utils
|
| 69 |
|
| 70 |
# Hugging Face Hub Settings
|
| 71 |
+
FROM dev AS hf
|
| 72 |
+
WORKDIR ${WORKDIR}
|
| 73 |
+
|
| 74 |
+
# REF: https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo#:~:text=As%20discussed%20in,the%20Dockerfile.
|
| 75 |
+
# Set up a new user named "user" with user ID 1000
|
| 76 |
+
RUN useradd -m -u 1000 user
|
| 77 |
+
|
| 78 |
+
# Switch to the "user" user
|
| 79 |
+
USER user
|
| 80 |
+
|
| 81 |
+
# Set home to the user's home directory
|
| 82 |
+
ENV HOME=/home/user \
|
| 83 |
+
PATH=/home/user/.local/bin:$PATH
|
| 84 |
+
|
| 85 |
+
# Set the working directory to the user's home directory
|
| 86 |
+
WORKDIR $HOME/app
|
| 87 |
+
|
| 88 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 89 |
+
COPY --chown=user . $HOME/app
|
| 90 |
+
## install Poetry
|
| 91 |
+
RUN curl -sSL https://install.python-poetry.org | python3 -
|
| 92 |
+
ENV PATH $PATH:/root/.local/bin
|
| 93 |
+
RUN poetry config virtualenvs.create true \
|
| 94 |
+
&& poetry config virtualenvs.in-project false
|
| 95 |
+
|
| 96 |
+
RUN poetry install --no-dev
|
| 97 |
+
RUN poetry install
|
| 98 |
+
|
| 99 |
CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"]
|