Update Dockerfile
Browse files- Dockerfile +10 -19
Dockerfile
CHANGED
|
@@ -1,32 +1,23 @@
|
|
| 1 |
-
# Use the official AFFiNE stable image (Debian-based)
|
| 2 |
FROM ghcr.io/toeverything/affine:stable
|
| 3 |
|
| 4 |
-
#
|
| 5 |
ENV PORT=7860
|
| 6 |
EXPOSE 7860
|
| 7 |
|
| 8 |
-
# Switch to root to install Redis and fix permissions for Hugging Face
|
| 9 |
USER root
|
| 10 |
-
|
| 11 |
-
# Install Redis server for caching and queues
|
| 12 |
RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN mkdir -p /
|
| 16 |
-
chown -R 1000:1000 /affine
|
| 17 |
|
| 18 |
-
# Switch back to the Hugging Face user
|
| 19 |
USER 1000
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
ENV
|
| 23 |
-
ENV
|
| 24 |
-
|
| 25 |
-
# Point AFFiNE to the local Redis instance we are about to start
|
| 26 |
ENV REDIS_SERVER_HOST=localhost
|
| 27 |
-
ENV REDIS_SERVER_PORT=6379
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
CMD ["sh", "-c", "redis-server --daemonize yes --dir /tmp && node ./scripts/self-host-predeploy.js && node ./dist/index.js"]
|
|
|
|
|
|
|
| 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"]
|
|
|