Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +73 -5
Dockerfile
CHANGED
|
@@ -1,14 +1,82 @@
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
FROM python:3.9
|
| 5 |
|
| 6 |
-
WORKDIR /code
|
| 7 |
|
| 8 |
-
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
-
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
+
# FROM python:3.9
|
| 5 |
|
| 6 |
+
# WORKDIR /code
|
| 7 |
|
| 8 |
+
# COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
+
# RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
+
# COPY . .
|
| 13 |
+
|
| 14 |
+
#FROM nvcr.io/nvidia/tensorflow:23.07-tf2-py3
|
| 15 |
+
FROM tensorflow/tensorflow:2.15.0
|
| 16 |
+
# use the cpu image that the nvidia image was based on
|
| 17 |
+
|
| 18 |
+
# specify vscode as the user name in the docker
|
| 19 |
+
# This user name should match that of the VS Code .devcontainer to allow seamless development inside the docker container via vscode
|
| 20 |
+
ARG USERNAME=vscode
|
| 21 |
+
ARG USER_UID=1001
|
| 22 |
+
ARG USER_GID=$USER_UID
|
| 23 |
+
|
| 24 |
+
# Create a non-root user
|
| 25 |
+
RUN groupadd --gid $USER_GID $USERNAME \
|
| 26 |
+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
| 27 |
+
# [Optional] Add sudo support for the non-root user - this is ok for development dockers only
|
| 28 |
+
&& apt-get update \
|
| 29 |
+
&& apt-get install -y sudo \
|
| 30 |
+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
| 31 |
+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
| 32 |
+
# Cleanup
|
| 33 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 34 |
+
# Set up git completion.
|
| 35 |
+
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
|
| 36 |
+
|
| 37 |
+
# Packages installation (eg git-lfs)
|
| 38 |
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
| 39 |
+
&& apt-get -y install --no-install-recommends curl git-lfs ffmpeg libsm6 libxext6 graphviz libsndfile1-dev libgraphviz-dev xdg-utils swig gringo gobject-introspection libcairo2-dev libgirepository1.0-dev pkg-config python3-dev python3-gi python3-tk
|
| 40 |
+
|
| 41 |
+
#COPY docker/docker-font.conf /etc/fonts/local.conf
|
| 42 |
+
#ENV FREETYPE_PROPERTIES="truetype:interpreter-version=35"
|
| 43 |
+
#RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
|
| 44 |
+
#RUN apt-get update \
|
| 45 |
+
#&& apt-get install -y --no-install-recommends fontconfig ttf-mscorefonts-installer
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
USER vscode
|
| 49 |
+
|
| 50 |
+
# ACT for executing locally Github workflows
|
| 51 |
+
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
|
| 52 |
+
|
| 53 |
+
# NVM for managing npm versions
|
| 54 |
+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | sudo bash
|
| 55 |
+
|
| 56 |
+
# Git LFS repo configuration
|
| 57 |
+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
| 58 |
+
|
| 59 |
+
# inscape installation for managing svg files
|
| 60 |
+
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
| 61 |
+
&& sudo apt-get -y install --no-install-recommends inkscape
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
SHELL ["/bin/bash", "-c"]
|
| 65 |
+
ENV PATH="/home/vscode/.local/bin:$PATH"
|
| 66 |
+
ENV GI_TYPELIB_PATH="/usr/lib/x86_64-linux-gnu/girepository-1.0"
|
| 67 |
+
|
| 68 |
+
# Install dependencies:
|
| 69 |
+
# COPY . .
|
| 70 |
+
# RUN pip install -r requirements.txt
|
| 71 |
+
|
| 72 |
+
RUN pip install --upgrade pip
|
| 73 |
+
RUN pip install pipenv
|
| 74 |
+
COPY Pipfile.lock Pipfile /tmp/
|
| 75 |
+
WORKDIR /tmp
|
| 76 |
+
RUN pipenv install --system --deploy --ignore-pipfile
|
| 77 |
+
|
| 78 |
+
WORKDIR /workspaces/artificial_intelligence
|
| 79 |
+
|
| 80 |
+
COPY . .
|
| 81 |
|
| 82 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|