Subham9126 commited on
Commit
d9333b6
·
verified ·
1 Parent(s): 852e2b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
  # Use the official Wiki.js version 2 image
2
  FROM requarks/wiki:2
3
 
 
 
 
 
 
 
 
 
4
  # Hugging Face Spaces strictly require the app to listen on port 7860
5
- ENV PORT=7860
6
  EXPOSE 7860
7
 
8
  # Hugging Face Spaces execute containers as a non-root user (UID 1000).
9
- # Wiki.js needs write access to its own directory for the setup wizard, logs, and cache.
10
- USER root
11
  RUN chown -R 1000:1000 /wiki
12
 
13
- # Switch to the Hugging Face user
14
  USER 1000
15
 
16
  # Start the Wiki.js server
 
1
  # Use the official Wiki.js version 2 image
2
  FROM requarks/wiki:2
3
 
4
+ # Switch to root to modify files during the build
5
+ USER root
6
+
7
+ # Wiki.js hardcodes port 3000 in its default config file.
8
+ # We copy the sample config and use 'sed' to forcefully change it to 7860.
9
+ RUN cp config.sample.yml config.yml && \
10
+ sed -i 's/port: 3000/port: 7860/g' config.yml
11
+
12
  # Hugging Face Spaces strictly require the app to listen on port 7860
 
13
  EXPOSE 7860
14
 
15
  # Hugging Face Spaces execute containers as a non-root user (UID 1000).
16
+ # Wiki.js needs write access to its own directory for logs and setup.
 
17
  RUN chown -R 1000:1000 /wiki
18
 
19
+ # Switch back to the Hugging Face user
20
  USER 1000
21
 
22
  # Start the Wiki.js server