softwareDevelopment commited on
Commit
29bc8d6
·
verified ·
1 Parent(s): 7a89fae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 use port 7860
24
- RUN echo 'run_as shiny;\n\
25
- \n\
26
- server {\n\
27
- listen 7860;\n\
28
- \n\
29
- location / {\n\
30
- site_dir /srv/shiny-server/app;\n\
31
- log_dir /var/log/shiny-server;\n\
32
- directory_index on;\n\
33
- }\n\
34
- }' > /etc/shiny-server/shiny-server.conf
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