Spaces:
Sleeping
Sleeping
Jirat Jaturanpinyo
commited on
Update Dockerfile
Browse files- Dockerfile +17 -7
Dockerfile
CHANGED
@@ -1,14 +1,24 @@
|
|
1 |
-
# Use the official Python 3.
|
2 |
FROM python:3.11.3
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
-
# Set the
|
8 |
-
|
|
|
9 |
|
10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
12 |
|
13 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
14 |
-
CMD ["python", "run.py", "--voicevox_dir", "../linux-cpu","--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use the official Python 3.11.3 image
|
2 |
FROM python:3.11.3
|
3 |
|
4 |
+
# Set up a new user named "user" with user ID 1000
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
|
7 |
+
# Set the home to the user's home directory and add user's local bin to PATH
|
8 |
+
ENV HOME=/home/user \
|
9 |
+
PATH=/home/user/.local/bin:$PATH
|
10 |
|
11 |
+
# Switch to the "user" user
|
12 |
+
USER user
|
13 |
+
|
14 |
+
# Create the app directory
|
15 |
+
WORKDIR $HOME/app
|
16 |
+
|
17 |
+
# Copy the current directory contents into the container at $HOME/app and set the owner to the user
|
18 |
+
COPY --chown=user . $HOME/app
|
19 |
+
|
20 |
+
# Install requirements.txt
|
21 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
22 |
|
23 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
24 |
+
CMD ["python", "run.py", "--voicevox_dir", "../linux-cpu", "--host", "0.0.0.0", "--port", "7860"]
|