Subham9126 commited on
Commit
38a0f07
·
verified ·
1 Parent(s): 6f1c4fd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -18
Dockerfile CHANGED
@@ -1,23 +1,19 @@
1
- FROM ghcr.io/toeverything/affine:stable
2
 
3
- # Port for Hugging Face
4
- ENV PORT=7860
5
- EXPOSE 7860
 
 
 
 
6
 
 
7
  USER root
8
- # Install Redis
9
- RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
10
 
11
- # Ensure the config directory exists and is writable by the HF user (1000)
12
- RUN mkdir -p /home/node/.affine && chown -R 1000:1000 /home/node/.affine
13
 
14
- USER 1000
15
-
16
- # AFFiNE Environment Variables
17
- ENV NODE_ENV=production
18
- ENV AFFINE_CONFIG_PATH=/home/node/.affine
19
- ENV REDIS_SERVER_HOST=localhost
20
-
21
- # Fix: Use the correct entry point path for the stable image
22
- # We start Redis, run the database setup, then launch the app via 'node ./dist/main.js'
23
- CMD ["sh", "-c", "redis-server --daemonize yes --dir /tmp && node ./scripts/self-host-predeploy.js && node ./dist/main.js"]
 
1
+ FROM requarks/wiki:2
2
 
3
+ # --- Hardcoded Environment Variables ---
4
+ # Tells Wiki.js to use SQLite
5
+ ENV DB_TYPE=sqlite
6
+ # Where to save the database file inside the container
7
+ ENV DB_FILEPATH=/wiki/data/db.sqlite
8
+ # The port HF Spaces expects
9
+ ENV PORT=3000
10
 
11
+ # Ensure the directory exists and is writable
12
  USER root
13
+ RUN mkdir -p /wiki/data && chown -R node:node /wiki/data
 
14
 
15
+ # Switch to the default node user for security
16
+ USER node
17
 
18
+ EXPOSE 3000
19
+ CMD ["node", "server"]