Spaces:
Sleeping
Sleeping
rida saghir
commited on
Commit
·
52e7e4d
1
Parent(s):
9e8a36f
Added dockerfile
Browse files- Dockerfile +61 -0
Dockerfile
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ARG GRADIO_ACOUSTIC
|
| 2 |
+
FROM python:3.9.6
|
| 3 |
+
|
| 4 |
+
LABEL maintainer="Rida Saghir ridasagheer94@gmail.com"
|
| 5 |
+
|
| 6 |
+
# Define build arguments for accessing the repository
|
| 7 |
+
ARG GITLAB_DEPLOYTOKEN_USERNAME=gitlab+deploy+lts
|
| 8 |
+
ARG GITLAB_DEPLOYTOKEN_PASSWORD=gldt-xMH79XLsNs3swTMZsmqv
|
| 9 |
+
|
| 10 |
+
# Set the Git repository URL with deploy token
|
| 11 |
+
ARG REPO_URL=https://$GITLAB_DEPLOYTOKEN_USERNAME:$GITLAB_DEPLOYTOKEN_PASSWORD@git.ni.dfki.de/iml/cst/lts-acoustic-monitoring-interface.git
|
| 12 |
+
|
| 13 |
+
# Clone the Git repository
|
| 14 |
+
RUN git clone ${REPO_URL} /lts_app
|
| 15 |
+
|
| 16 |
+
# Set the working directory
|
| 17 |
+
WORKDIR /gradio_app
|
| 18 |
+
|
| 19 |
+
RUN chmod 777 /lts_app
|
| 20 |
+
RUN mkdir /demo
|
| 21 |
+
RUN chmod 777 /demo
|
| 22 |
+
|
| 23 |
+
# Copy the current directory contents into the container
|
| 24 |
+
COPY . /gradio_app
|
| 25 |
+
ADD requirements.txt /gradio_app/requirements.txt
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# Copy the Linux version of frpc into the container
|
| 29 |
+
#COPY frpc_linux_aarch64_v0.2 /usr/local/lib/python3.9/site-packages/gradio/frpc_linux_aarch64_v0.2
|
| 30 |
+
|
| 31 |
+
# Install dependencies
|
| 32 |
+
RUN pip install -r requirements.txt
|
| 33 |
+
|
| 34 |
+
#RUN apt-get update && apt-get install -y libsndfile1
|
| 35 |
+
|
| 36 |
+
# Set up a new user named "user" with user ID 1000
|
| 37 |
+
RUN useradd -m -u 1000 user
|
| 38 |
+
# Switch to the "user" user
|
| 39 |
+
USER user
|
| 40 |
+
|
| 41 |
+
# Set the working directory to the user's home directory
|
| 42 |
+
WORKDIR $HOME/app
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
# Make port available to the world outside this container
|
| 46 |
+
EXPOSE 7860/tcp
|
| 47 |
+
|
| 48 |
+
# Define environment variable
|
| 49 |
+
ENV NAME Acoustic
|
| 50 |
+
|
| 51 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 52 |
+
COPY --chown=user . $HOME/app
|
| 53 |
+
|
| 54 |
+
# add directory /lts_app to the save list so that it is possible to get branch, hash, tag
|
| 55 |
+
RUN git config --global --add safe.directory /lts_app
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
# Run your application
|
| 59 |
+
CMD ["python3", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|
| 60 |
+
|
| 61 |
+
|