Update Dockerfile
Browse files- Dockerfile +37 -8
Dockerfile
CHANGED
|
@@ -1,19 +1,48 @@
|
|
| 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 |
|
| 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}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
| 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 |
+
FROM mintplexlabs/anythingllm:render
|
| 22 |
+
|
| 23 |
+
USER root
|
| 24 |
+
|
| 25 |
+
# Create storage directory and link
|
| 26 |
+
RUN mkdir -p /data/storage
|
| 27 |
+
RUN ln -s /data/storage /storage
|
| 28 |
+
|
| 29 |
+
# Switch to user for AnythingLLM
|
| 30 |
+
USER anythingllm
|
| 31 |
+
|
| 32 |
+
# Set environment variables for storage and server port
|
| 33 |
+
ENV STORAGE_DIR="/data/storage"
|
| 34 |
+
ENV SERVER_PORT=7860
|
| 35 |
+
|
| 36 |
+
# Copy the custom script to handle the backup
|
| 37 |
+
COPY copy-storage.sh /usr/local/bin/copy-storage.sh
|
| 38 |
+
|
| 39 |
+
# Ensure the script has execution permissions
|
| 40 |
+
USER root
|
| 41 |
+
RUN chmod +x /usr/local/bin/copy-storage.sh
|
| 42 |
+
|
| 43 |
+
# Switch back to the anythingllm user
|
| 44 |
+
USER anythingllm
|
| 45 |
+
|
| 46 |
+
# Set the entry point to run the script and the main application
|
| 47 |
+
ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]
|
| 48 |
+
|