Kaballas commited on
Commit
9c28eaa
·
verified ·
1 Parent(s): 64e10c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -19
Dockerfile CHANGED
@@ -1,27 +1,39 @@
1
- FROM mintplexlabs/anythingllm:render
 
2
 
3
- USER root
 
 
 
4
 
5
- # Create storage directory and link
6
- RUN mkdir -p /data/storage
7
- RUN ln -s /data/storage /storage
8
 
9
- # Switch to user for AnythingLLM
10
- USER anythingllm
11
 
12
- # Set environment variables for storage and server port
13
- ENV STORAGE_DIR="/data/storage"
14
- ENV SERVER_PORT=7860
 
 
 
 
 
 
 
 
 
 
15
 
16
- # Copy the custom script to handle the backup
17
- COPY copy-storage.sh /usr/local/bin/copy-storage.sh
18
 
19
- # Ensure the script has execution permissions
20
- USER root
21
- RUN chmod +x /usr/local/bin/copy-storage.sh
22
 
23
- # Switch back to the anythingllm user
24
- USER anythingllm
25
 
26
- # Set the entry point to run the script and the main application
27
- ENTRYPOINT ["/bin/bash","/usr/local/bin/render-entrypoint.sh"]
 
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
+ # Install Python dependencies
23
+ COPY requirements.txt .
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Install sqlite-web
27
+ RUN pip install sqlite-web
28
 
29
+ # Copy application code
30
+ COPY . .
31
 
32
+ # Ensure the entrypoint script has execution permissions
33
+ RUN chmod +x /app/entrypoint.sh
 
34
 
35
+ # Expose necessary ports
36
+ EXPOSE $SERVER_PORT 8080
37
 
38
+ # Set the entrypoint
39
+ ENTRYPOINT ["/app/entrypoint.sh"]