Spaces:
Runtime error
Runtime error
switch to user
Browse files- Dockerfile +19 -5
Dockerfile
CHANGED
@@ -4,17 +4,31 @@ RUN apt update
|
|
4 |
RUN apt install -y git libsndfile1-dev python3 python3-dev python3-pip ffmpeg
|
5 |
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
wget -c https://github.com/openvpi/vocoders/releases/download/nsf-hifigan-v1/nsf_hifigan_20221211.zip && \
|
11 |
unzip -q nsf_hifigan_20221211.zip
|
12 |
|
13 |
-
RUN pip install --no-cache-dir --upgrade -r /
|
14 |
|
15 |
ENV SERVER_NAME="0.0.0.0"
|
16 |
ENV SERVER_PORT=7860
|
17 |
|
18 |
-
WORKDIR /
|
19 |
|
20 |
CMD ["python3", "webUI.py"]
|
|
|
4 |
RUN apt install -y git libsndfile1-dev python3 python3-dev python3-pip ffmpeg
|
5 |
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
6 |
|
7 |
+
# Set up a new user named "user" with user ID 1000
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
+
|
10 |
+
# Switch to the "user" user
|
11 |
+
USER user
|
12 |
+
|
13 |
+
# Set home to the user's home directory
|
14 |
+
ENV HOME=/home/user \
|
15 |
+
PATH=/home/user/.local/bin:$PATH
|
16 |
+
|
17 |
+
# Set the working directory to the user's home directory
|
18 |
+
WORKDIR $HOME/
|
19 |
+
|
20 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
21 |
+
COPY --chown=user . .
|
22 |
+
|
23 |
+
RUN cd $HOME/so-vits-svc/pretrain && \
|
24 |
wget -c https://github.com/openvpi/vocoders/releases/download/nsf-hifigan-v1/nsf_hifigan_20221211.zip && \
|
25 |
unzip -q nsf_hifigan_20221211.zip
|
26 |
|
27 |
+
RUN pip install --no-cache-dir --upgrade -r $HOME/so-vits-svc/requirements.txt
|
28 |
|
29 |
ENV SERVER_NAME="0.0.0.0"
|
30 |
ENV SERVER_PORT=7860
|
31 |
|
32 |
+
WORKDIR $HOME/so-vits-svc
|
33 |
|
34 |
CMD ["python3", "webUI.py"]
|