Entreprenerdly commited on
Commit
9bbcc1e
·
verified ·
1 Parent(s): 3d83381

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -5
Dockerfile CHANGED
@@ -2,19 +2,38 @@ FROM python:3.10.7
2
 
3
  WORKDIR /app
4
 
5
- # Install pre-built sqlite3
6
  RUN apt-get update && \
7
- apt-get install -y sqlite3 libsqlite3-dev && \
8
  apt-get clean
9
 
 
 
 
 
 
 
 
 
 
 
 
10
  # Verify the sqlite3 version
11
  RUN sqlite3 --version
12
 
13
- COPY requirements.txt /app/requirements.txt
 
 
 
 
14
 
15
- RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
 
 
 
 
16
 
17
- COPY. /app
18
 
19
  # Change permissions for the app directory
20
  RUN chmod -R 777 /app
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install dependencies for building sqlite3 from source
6
  RUN apt-get update && \
7
+ apt-get install -y wget build-essential libsqlite3-dev && \
8
  apt-get clean
9
 
10
+ # Download and compile the latest sqlite3
11
+ RUN wget https://www.sqlite.org/2023/sqlite-autoconf-3430000.tar.gz && \
12
+ tar xzf sqlite-autoconf-3430000.tar.gz && \
13
+ cd sqlite-autoconf-3430000 && \
14
+ ./configure && \
15
+ make && \
16
+ make install && \
17
+ ldconfig && \
18
+ cd .. && \
19
+ rm -rf sqlite-autoconf-3430000 sqlite-autoconf-3430000.tar.gz
20
+
21
  # Verify the sqlite3 version
22
  RUN sqlite3 --version
23
 
24
+ # Set environment variables to ensure the new SQLite is used
25
+ ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
26
+ ENV PATH="/usr/local/bin:${PATH}"
27
+
28
+ COPY ./requirements.txt /app/requirements.txt
29
 
30
+ # Install Python dependencies
31
+ RUN pip install --no-cache-dir --upgrade pip && \
32
+ pip install --no-cache-dir fastapi==0.110.0 && \
33
+ pip install --no-cache-dir --no-deps -r /app/requirements.txt && \
34
+ pip install --no-cache-dir uvicorn[standard]
35
 
36
+ COPY . /app
37
 
38
  # Change permissions for the app directory
39
  RUN chmod -R 777 /app