Update Dockerfile
Browse files- Dockerfile +14 -18
Dockerfile
CHANGED
|
@@ -1,23 +1,19 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
| 7 |
USER root
|
| 8 |
-
|
| 9 |
-
RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 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"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|