jmanhype
commited on
Commit
Β·
9de475d
1
Parent(s):
6655d5c
fix: add matplotlib and gradio directory permissions
Browse files- scripts/gradio/Dockerfile +15 -10
scripts/gradio/Dockerfile
CHANGED
|
@@ -5,21 +5,22 @@ LABEL MAINTAINER="anchorxia, zhanchao"
|
|
| 5 |
LABEL Email="[email protected], [email protected]"
|
| 6 |
LABEL Description="musev gradio image, from docker pull anchorxia/musev:latest"
|
| 7 |
|
| 8 |
-
# Install VSCode server using curl
|
| 9 |
-
USER root
|
| 10 |
-
RUN curl -L https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz -o /tmp/openvscode-server.tar.gz && \
|
| 11 |
-
tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
|
| 12 |
-
rm /tmp/openvscode-server.tar.gz && \
|
| 13 |
-
mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
|
| 14 |
-
chown -R 1000:1000 /opt/openvscode-server
|
| 15 |
-
|
| 16 |
# Set up git config file
|
|
|
|
| 17 |
RUN rm -rf /etc/gitconfig && \
|
| 18 |
touch /etc/gitconfig && \
|
| 19 |
chmod 666 /etc/gitconfig && \
|
| 20 |
git config --system user.email "[email protected]" && \
|
| 21 |
git config --system user.name "jmanhype"
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
SHELL ["/bin/bash", "--login", "-c"]
|
| 24 |
|
| 25 |
# Set up a new user named "user" with user ID 1000
|
|
@@ -28,9 +29,13 @@ RUN useradd -m -u 1000 user
|
|
| 28 |
# Switch to the "user" user
|
| 29 |
USER user
|
| 30 |
|
| 31 |
-
# Set home to the user's home directory
|
| 32 |
ENV HOME=/home/user \
|
| 33 |
-
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Set the working directory to the user's home directory
|
| 36 |
WORKDIR $HOME/app
|
|
|
|
| 5 |
LABEL Email="[email protected], [email protected]"
|
| 6 |
LABEL Description="musev gradio image, from docker pull anchorxia/musev:latest"
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Set up git config file
|
| 9 |
+
USER root
|
| 10 |
RUN rm -rf /etc/gitconfig && \
|
| 11 |
touch /etc/gitconfig && \
|
| 12 |
chmod 666 /etc/gitconfig && \
|
| 13 |
git config --system user.email "[email protected]" && \
|
| 14 |
git config --system user.name "jmanhype"
|
| 15 |
|
| 16 |
+
# Create necessary directories with proper permissions
|
| 17 |
+
RUN mkdir -p /home/user/.config/matplotlib && \
|
| 18 |
+
mkdir -p /home/user/app/flagged && \
|
| 19 |
+
chown -R 1000:1000 /home/user/.config && \
|
| 20 |
+
chown -R 1000:1000 /home/user/app && \
|
| 21 |
+
chmod -R 777 /home/user/.config && \
|
| 22 |
+
chmod -R 777 /home/user/app
|
| 23 |
+
|
| 24 |
SHELL ["/bin/bash", "--login", "-c"]
|
| 25 |
|
| 26 |
# Set up a new user named "user" with user ID 1000
|
|
|
|
| 29 |
# Switch to the "user" user
|
| 30 |
USER user
|
| 31 |
|
| 32 |
+
# Set home to the user's home directory and configure matplotlib
|
| 33 |
ENV HOME=/home/user \
|
| 34 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 35 |
+
SKIP_VSCODE=true \
|
| 36 |
+
DISABLE_VSCODE_INSTALLATION=true \
|
| 37 |
+
HF_SPACE_NO_VSCODE=true \
|
| 38 |
+
MPLCONFIGDIR=/home/user/.config/matplotlib
|
| 39 |
|
| 40 |
# Set the working directory to the user's home directory
|
| 41 |
WORKDIR $HOME/app
|