Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +32 -37
Dockerfile
CHANGED
@@ -1,42 +1,37 @@
|
|
1 |
-
|
2 |
-
FROM ghcr.io/coleifer/sqlite-web:latest
|
3 |
|
4 |
-
|
5 |
-
ENV STORAGE_DIR="/data/storage"
|
6 |
-
ENV SERVER_PORT=7860
|
7 |
-
ENV SQLITE_DATABASE="${STORAGE_DIR}/anythingllm.db"
|
8 |
-
|
9 |
-
# Expose the server port
|
10 |
-
EXPOSE ${SERVER_PORT}
|
11 |
|
12 |
-
|
13 |
-
|
14 |
|
|
|
|
|
15 |
# Create the storage directory and set permissions
|
16 |
-
RUN mkdir -p ${STORAGE_DIR} && chmod -R 777 ${STORAGE_DIR}
|
17 |
-
|
18 |
# Command to run SQLite Web using the correct option for specifying the database file
|
19 |
-
CMD sqlite_web --host=0.0.0.0 --port=${SERVER_PORT} ${SQLITE_DATABASE}
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
#
|
24 |
-
|
25 |
-
|
26 |
-
#
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
#
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
#
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
# Set the entry point to run the script and the main application
|
41 |
-
#ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]
|
42 |
-
|
|
|
1 |
+
## Use the official SQLite Web image as the base image
|
2 |
+
#FROM ghcr.io/coleifer/sqlite-web:latest
|
3 |
|
4 |
+
## Set environment variables
|
5 |
+
#ENV STORAGE_DIR="/data/storage"
|
6 |
+
#ENV SERVER_PORT=7860
|
7 |
+
#ENV SQLITE_DATABASE="${STORAGE_DIR}/anythingllm.db"
|
|
|
|
|
|
|
8 |
|
9 |
+
## Expose the server port
|
10 |
+
#EXPOSE ${SERVER_PORT}
|
11 |
|
12 |
+
## Set the working directory
|
13 |
+
#WORKDIR /data
|
14 |
# Create the storage directory and set permissions
|
15 |
+
#RUN mkdir -p ${STORAGE_DIR} && chmod -R 777 ${STORAGE_DIR}
|
|
|
16 |
# Command to run SQLite Web using the correct option for specifying the database file
|
17 |
+
#CMD sqlite_web --host=0.0.0.0 --port=${SERVER_PORT} ${SQLITE_DATABASE}
|
18 |
+
|
19 |
+
FROM mintplexlabs/anythingllm:render
|
20 |
+
USER root
|
21 |
+
# Create storage directory and link
|
22 |
+
RUN mkdir -p /data/storage
|
23 |
+
RUN ln -s /data/storage /storage
|
24 |
+
# Switch to user for AnythingLLM
|
25 |
+
USER anythingllm
|
26 |
+
# Set environment variables for storage and server port
|
27 |
+
ENV STORAGE_DIR="/data/storage"
|
28 |
+
ENV SERVER_PORT=7860
|
29 |
+
# Copy the custom script to handle the backup
|
30 |
+
COPY copy-storage.sh /usr/local/bin/copy-storage.sh
|
31 |
+
Ensure the script has execution permissions
|
32 |
+
USER root
|
33 |
+
RUN chmod +x /usr/local/bin/copy-storage.sh
|
34 |
+
# Switch back to the anythingllm user
|
35 |
+
USER anythingllm
|
36 |
+
Set the entry point to run the script and the main application
|
37 |
+
ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]
|
|
|
|
|
|