Kaballas commited on
Commit
a8f9828
·
verified ·
1 Parent(s): 60cf1df

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -29
Dockerfile CHANGED
@@ -1,42 +1,40 @@
1
- # Use the official Python image as the base
2
- FROM python:3.11-slim
3
 
4
- # Set environment variables
5
- ENV STORAGE_DIR="/app/server/storage"
6
- ENV SERVER_PORT=7860
7
- ENV SQLITE_DATABASE="/app/database/your_database.db"
8
 
9
- # Create necessary directories
10
- RUN mkdir -p $STORAGE_DIR /app/database
 
11
 
12
- # Set the working directory
13
- WORKDIR /app
 
 
14
 
15
- # Install system dependencies
16
  RUN apt-get update && \
17
  apt-get install -y --no-install-recommends \
18
- build-essential \
19
- libsqlite3-dev \
20
- && rm -rf /var/lib/apt/lists/*
21
-
22
- # Copy Python requirements file
23
- COPY requirements.txt .
24
 
25
- # Install Python dependencies
26
- RUN pip install --no-cache-dir -r requirements.txt
27
 
28
- # Install sqlite-web
29
- RUN pip install sqlite-web
30
 
31
- # Copy the entrypoint script and other application files
32
- COPY entrypoint.sh /app/entrypoint.sh
33
- COPY . .
34
 
35
- # Ensure the entrypoint script has execution permissions
36
- RUN chmod +x /app/entrypoint.sh
37
 
38
- # Expose necessary ports
39
  EXPOSE $SERVER_PORT 8080
40
 
41
- # Set the entrypoint
42
- ENTRYPOINT ["/app/entrypoint.sh"]
 
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"]