File size: 1,397 Bytes
1161dd2
 
 
 
 
 
 
 
 
 
 
 
b31b57c
841affc
c5ead43
 
4d944df
b31b57c
ba882be
cdf8fe1
7adfb47
0088bb8
7adfb47
 
 
c0d40b0
1161dd2
b11b552
 
1161dd2
 
1a47b51
 
c0d40b0
 
 
1a47b51
cadfaa8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use an official Python runtime as a parent image, specifically the slim version to keep the image size down
FROM python:3.11-slim

# Set the working directory to /app inside the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Create the diskcache_dir directory and grant appropriate permissions
RUN mkdir -p /app/diskcache_dir && chmod -R 777 /app/diskcache_dir
RUN mkdir -p /app/sqlite_dir && chmod -R 777 /app/sqlite_dir
RUN mkdir -p /app/chroma_dir && chmod -R 777 /app/chroma_dir
RUN chmod -R 777 /app/web

RUN touch /app/error.log /app/access.log && chmod -R 777 /app/error.log /app/access.log

# https://stackoverflow.com/questions/52535788/nltk-download-not-working-inside-docker-for-a-django-service
RUN mkdir -p /app/nltk_data/tokenizers && chmod -R 777 /app/nltk_data
ENV NLTK_DATA /app/nltk_data/
ADD . $NLTK_DATA

RUN python -m nltk.downloader punkt

# Make port 7860 available to the world outside this container
EXPOSE 7860

# Define the command to run on container start. This script starts the Flask application.
# CMD ["python", "create_sqlite_db.py"]
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "rag_gpt_app:app"]

# Grant execution permissions to the start-up script
RUN chmod a+x start.sh
CMD ["./start.sh"]