Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +27 -29
Dockerfile
CHANGED
@@ -1,42 +1,40 @@
|
|
1 |
-
# Use the
|
2 |
-
FROM
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
ENV SERVER_PORT=7860
|
7 |
-
ENV SQLITE_DATABASE="/app/database/your_database.db"
|
8 |
|
9 |
-
# Create
|
10 |
-
RUN mkdir -p
|
|
|
11 |
|
12 |
-
# Set
|
13 |
-
|
|
|
|
|
14 |
|
15 |
-
# Install
|
16 |
RUN apt-get update && \
|
17 |
apt-get install -y --no-install-recommends \
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
# Copy Python requirements file
|
23 |
-
COPY requirements.txt .
|
24 |
|
25 |
-
#
|
26 |
-
|
27 |
|
28 |
-
#
|
29 |
-
RUN
|
30 |
|
31 |
-
# Copy the entrypoint script
|
32 |
-
COPY entrypoint.sh /
|
33 |
-
|
34 |
|
35 |
-
#
|
36 |
-
|
37 |
|
38 |
-
# Expose
|
39 |
EXPOSE $SERVER_PORT 8080
|
40 |
|
41 |
-
# Set the entrypoint
|
42 |
-
ENTRYPOINT ["/
|
|
|
1 |
+
# Use the existing image for AnythingLLM as the base
|
2 |
+
FROM mintplexlabs/anythingllm:render
|
3 |
|
4 |
+
# Switch to root user for administrative tasks
|
5 |
+
USER root
|
|
|
|
|
6 |
|
7 |
+
# Create storage directory and link
|
8 |
+
RUN mkdir -p /data/storage
|
9 |
+
RUN ln -s /data/storage /storage
|
10 |
|
11 |
+
# Set environment variables for storage and server port
|
12 |
+
ENV STORAGE_DIR="/data/storage"
|
13 |
+
ENV SERVER_PORT=7860
|
14 |
+
ENV SQLITE_DATABASE="/data/storage/sqlite.db"
|
15 |
|
16 |
+
# Install Python dependencies for sqlite-web
|
17 |
RUN apt-get update && \
|
18 |
apt-get install -y --no-install-recommends \
|
19 |
+
python3-pip libsqlite3-dev && \
|
20 |
+
pip3 install sqlite-web && \
|
21 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
22 |
|
23 |
+
# Copy the custom backup script
|
24 |
+
COPY copy-storage.sh /usr/local/bin/copy-storage.sh
|
25 |
|
26 |
+
# Ensure the backup script has execution permissions
|
27 |
+
RUN chmod +x /usr/local/bin/copy-storage.sh
|
28 |
|
29 |
+
# Copy the entrypoint script to handle sqlite-web and AnythingLLM
|
30 |
+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
31 |
+
RUN chmod +x /usr/local/bin/entrypoint.sh
|
32 |
|
33 |
+
# Switch back to AnythingLLM user
|
34 |
+
USER anythingllm
|
35 |
|
36 |
+
# Expose ports for AnythingLLM and sqlite-web
|
37 |
EXPOSE $SERVER_PORT 8080
|
38 |
|
39 |
+
# Set the entrypoint to the combined script
|
40 |
+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|