clr commited on
Commit
8586d58
·
1 Parent(s): 95afc3c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +54 -0
Dockerfile ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM mambaorg/micromamba:2.3.2
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./environment.yml /code/environment.yml
6
+ RUN micromamba install -y -n base -f /code/environment.yml && \
7
+ micromamba clean --all --yes
8
+ ARG MAMBA_DOCKERFILE_ACTIVATE=1
9
+
10
+ COPY ./requirements.txt /code/requirements.txt
11
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
+
13
+ USER root
14
+ RUN apt-get update && apt-get install -y build-essential wget unzip cmake
15
+ # Set up a new user named "user" with user ID 1000
16
+ RUN useradd -m -u 1000 user
17
+ # Switch to the "user" user
18
+ USER user
19
+ # Set home to the user's home directory
20
+ ENV HOME=/home/user \
21
+ PATH=/home/user/.local/bin:$PATH \
22
+ PYTHONPATH=$HOME/app \
23
+ PYTHONUNBUFFERED=1 \
24
+ GRADIO_ALLOW_FLAGGING=never \
25
+ GRADIO_NUM_PORTS=1 \
26
+ GRADIO_SERVER_NAME=0.0.0.0 \
27
+ GRADIO_THEME=huggingface \
28
+ SYSTEM=spaces
29
+
30
+ # Set the working directory to the user's home directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
34
+ COPY --chown=user . $HOME/app
35
+
36
+ # Install reaper for pitch tracking
37
+ RUN wget https://github.com/google/REAPER/archive/refs/heads/master.zip -O $HOME/app/REAPER.zip
38
+ RUN unzip $HOME/app/REAPER.zip
39
+ RUN rm $HOME/app/REAPER.zip
40
+ RUN mv $HOME/app/REAPER-master $HOME/app/REAPER
41
+ WORKDIR $HOME/app/REAPER
42
+ RUN ls
43
+ RUN mkdir build
44
+ WORKDIR $HOME/app/REAPER/build
45
+ RUN cmake $HOME/app/REAPER
46
+ RUN make
47
+
48
+ WORKDIR $HOME/app
49
+
50
+ RUN wget https://github.com/captini-org/pronunciation-score-icelandic/archive/refs/heads/fallback.zip -O $HOME/app/fallback.zip
51
+ RUN unzip $HOME/app/fallback.zip
52
+ RUN rm $HOME/app/fallback.zip
53
+ RUN mv $HOME/app/pronunciation-score-icelandic-fallback $HOME/app/pronunciation-score-icelandic
54
+ CMD ["python3.10", "app.py"]