@@ -27,7 +27,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
27
27
libxrender1 \
28
28
libxext6 \
29
29
ninja-build \
30
- && rm -rf /var/lib/apt/lists/*
30
+ sudo \
31
+ && rm -rf /var/lib/apt/lists/* \
32
+ && echo "appuser ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers
31
33
32
34
# Create and configure directories before switching user
33
35
RUN mkdir -p /app && \
@@ -63,19 +65,20 @@ RUN pip install --no-cache-dir \
63
65
RUN mkdir -p /app/outputs && \
64
66
chown -R $UID:$GID /app/outputs && \
65
67
mkdir -p $VIRTUAL_ENV && \
66
- chown -R $UID:$GID $VIRTUAL_ENV
68
+ chown -R $UID:$GID $VIRTUAL_ENV && \
69
+ mkdir -p /app/hf_download && \
70
+ chown -R $UID:$GID /app/hf_download
67
71
68
- # Model directory setup
69
- RUN mkdir -p /app/hf_download && \
70
- chmod -R 777 /app/hf_download
72
+ # Copy entrypoint script
73
+ COPY entrypoint.sh /entrypoint.sh
74
+ RUN chmod +x /entrypoint.sh && \
75
+ chown $UID:$GID /entrypoint.sh
71
76
72
- # Expose output directory
73
- RUN mkdir -p /app/outputs && \
74
- chmod -R 777 /app/outputs
77
+ EXPOSE 7860
75
78
76
- # Configure directories
79
+ # Configure volumes
77
80
VOLUME /app/hf_download
78
81
VOLUME /app/outputs
79
82
80
- EXPOSE 7860
81
- CMD ["python" , "demo_gradio.py" , "--share" ]
83
+ ENTRYPOINT [ "/entrypoint.sh" ]
84
+ CMD ["python" , "demo_gradio.py" , "--share" , "--server-name" , "0.0.0.0" ]
0 commit comments