Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +21 -5
Dockerfile
CHANGED
@@ -1,11 +1,27 @@
|
|
1 |
-
FROM python:3.9
|
2 |
|
3 |
-
WORKDIR /
|
4 |
-
|
5 |
-
COPY . /app
|
6 |
|
|
|
7 |
RUN apt-get update && apt-get install -y gifsicle
|
8 |
|
|
|
9 |
RUN pip install Pillow gradio
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9
|
2 |
|
3 |
+
WORKDIR /code
|
|
|
|
|
4 |
|
5 |
+
# Install Gifsicle
|
6 |
RUN apt-get update && apt-get install -y gifsicle
|
7 |
|
8 |
+
# Install Pillow and any other Python dependencies you need
|
9 |
RUN pip install Pillow gradio
|
10 |
|
11 |
+
# Set up a new user named "user" with user ID 1000
|
12 |
+
RUN useradd -m -u 1000 user
|
13 |
+
|
14 |
+
# Switch to the "user" user
|
15 |
+
USER user
|
16 |
+
|
17 |
+
# Set home to the user's home directory
|
18 |
+
ENV HOME=/home/user \
|
19 |
+
PATH=/home/user/.local/bin:$PATH
|
20 |
+
|
21 |
+
# Set the working directory to the user's home directory
|
22 |
+
WORKDIR $HOME/app
|
23 |
+
|
24 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
25 |
+
COPY --chown=user . $HOME/app
|
26 |
+
|
27 |
+
CMD ["python", "app.py"]
|