Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +48 -5
Dockerfile
CHANGED
@@ -1,5 +1,48 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the base image for AnythingLLM
|
2 |
+
FROM mintplexlabs/anythingllm:render
|
3 |
+
|
4 |
+
USER root
|
5 |
+
|
6 |
+
# Create storage directory and link
|
7 |
+
RUN mkdir -p /data/storage
|
8 |
+
RUN ln -s /data/storage /storage
|
9 |
+
|
10 |
+
# Set environment variables for AnythingLLM storage and server port
|
11 |
+
ENV STORAGE_DIR="/data/storage"
|
12 |
+
ENV SERVER_PORT=7860
|
13 |
+
|
14 |
+
# Create and set up SQLite Web specific environment and directories
|
15 |
+
RUN mkdir -p /data/sqlite
|
16 |
+
ENV SQLITE_DATABASE=db_filename.db
|
17 |
+
|
18 |
+
# Ensure compatibility for storage usage
|
19 |
+
RUN chmod -R 777 /data
|
20 |
+
|
21 |
+
# Copy the custom script to handle the backup
|
22 |
+
COPY copy-storage.sh /usr/local/bin/copy-storage.sh
|
23 |
+
|
24 |
+
# Ensure the script has execution permissions
|
25 |
+
RUN chmod +x /usr/local/bin/copy-storage.sh
|
26 |
+
|
27 |
+
# Switch to AnythingLLM user for safer operations
|
28 |
+
USER anythingllm
|
29 |
+
|
30 |
+
# Expose ports for AnythingLLM and SQLite Web
|
31 |
+
EXPOSE 7860
|
32 |
+
EXPOSE 8080
|
33 |
+
|
34 |
+
# Switch back to root for setup
|
35 |
+
USER root
|
36 |
+
|
37 |
+
# Set up SQLite Web entrypoint
|
38 |
+
RUN mkdir -p /usr/local/bin/sqlite-web
|
39 |
+
WORKDIR /usr/local/bin/sqlite-web
|
40 |
+
|
41 |
+
# Link /data directory for SQLite Web
|
42 |
+
RUN ln -s /data/sqlite /sqlite
|
43 |
+
|
44 |
+
# Switch back to AnythingLLM user
|
45 |
+
USER anythingllm
|
46 |
+
|
47 |
+
# Final entrypoint to handle both AnythingLLM and SQLite Web
|
48 |
+
ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]
|