Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -35
Dockerfile
CHANGED
@@ -1,48 +1,25 @@
|
|
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
|
11 |
ENV STORAGE_DIR="/data/storage"
|
12 |
ENV SERVER_PORT=7860
|
|
|
13 |
|
14 |
-
#
|
15 |
-
|
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 |
-
#
|
42 |
-
|
43 |
|
44 |
-
#
|
45 |
-
|
46 |
|
47 |
-
#
|
48 |
-
|
|
|
1 |
# Use the base image for AnythingLLM
|
2 |
FROM mintplexlabs/anythingllm:render
|
|
|
3 |
USER root
|
|
|
4 |
# Create storage directory and link
|
5 |
RUN mkdir -p /data/storage
|
6 |
RUN ln -s /data/storage /storage
|
7 |
+
# Use the official SQLite Web image as the base image
|
8 |
+
FROM ghcr.io/coleifer/sqlite-web:latest
|
9 |
|
10 |
+
# Set environment variables
|
11 |
ENV STORAGE_DIR="/data/storage"
|
12 |
ENV SERVER_PORT=7860
|
13 |
+
ENV SQLITE_DATABASE="${STORAGE_DIR}/db_filename.db"
|
14 |
|
15 |
+
# Expose the server port
|
16 |
+
EXPOSE ${SERVER_PORT}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
# Set the working directory
|
19 |
+
WORKDIR /data
|
20 |
|
21 |
+
# Create the storage directory and set permissions
|
22 |
+
RUN mkdir -p ${STORAGE_DIR} && chmod -R 777 ${STORAGE_DIR}
|
23 |
|
24 |
+
# Command to run SQLite Web
|
25 |
+
CMD ["sqlite_web", "--host=0.0.0.0", "--port=${SERVER_PORT}", "--database=${SQLITE_DATABASE}"]
|