Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -18
Dockerfile
CHANGED
|
@@ -20,24 +20,18 @@ EXPOSE 7860
|
|
| 20 |
# Copy app files into the Shiny server directory
|
| 21 |
COPY app.R /srv/shiny-server/app/app.R
|
| 22 |
|
| 23 |
-
# Override Shiny Server config to
|
| 24 |
-
RUN
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
\
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
# Fix permissions
|
| 37 |
-
RUN chown -R shiny:shiny /srv/shiny-server/app \
|
| 38 |
-
&& chmod -R 755 /srv/shiny-server/app
|
| 39 |
-
|
| 40 |
-
# HuggingFace requires the container to run as a non-root user (UID 1000)
|
| 41 |
RUN usermod -u 1000 shiny && groupmod -g 1000 shiny
|
| 42 |
|
| 43 |
USER shiny
|
|
|
|
| 20 |
# Copy app files into the Shiny server directory
|
| 21 |
COPY app.R /srv/shiny-server/app/app.R
|
| 22 |
|
| 23 |
+
# Override Shiny Server config — logs redirected to /tmp (always writable by non-root)
|
| 24 |
+
RUN printf 'run_as shiny;\n\nserver {\n listen 7860;\n\n location / {\n site_dir /srv/shiny-server/app;\n log_dir /tmp/shiny-logs;\n directory_index on;\n }\n}\n' \
|
| 25 |
+
> /etc/shiny-server/shiny-server.conf
|
| 26 |
+
|
| 27 |
+
# Create log dir and fix ALL permissions before switching to non-root user
|
| 28 |
+
RUN mkdir -p /tmp/shiny-logs \
|
| 29 |
+
&& chown -R shiny:shiny /srv/shiny-server/app \
|
| 30 |
+
&& chmod -R 755 /srv/shiny-server/app \
|
| 31 |
+
&& chown -R shiny:shiny /tmp/shiny-logs \
|
| 32 |
+
&& chmod -R 777 /tmp/shiny-logs
|
| 33 |
+
|
| 34 |
+
# HuggingFace requires the container to run as UID 1000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
RUN usermod -u 1000 shiny && groupmod -g 1000 shiny
|
| 36 |
|
| 37 |
USER shiny
|