srinidhidevaraj commited on
Commit
3625ac8
1 Parent(s): 0d2b5da

added book

Browse files
Files changed (2) hide show
  1. Dockerfile +19 -35
  2. app.py +2 -2
Dockerfile CHANGED
@@ -1,45 +1,29 @@
1
- # Use the official Python base image
2
- FROM python:3.9
3
-
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Copy the requirements.txt file and install the Python dependencies
8
- COPY requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Set up a new user named "user" with user ID 1000
12
- RUN useradd -m -u 1000 user
13
- # Switch to the "user" user
14
- USER user
15
- # Set home to the user's home directory
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
18
-
19
- # Set the working directory to the user's home directory
20
- WORKDIR $HOME/app
21
-
22
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
23
- COPY --chown=user . $HOME/app
24
-
25
- # Expose the port on which the Flask application will run
26
- EXPOSE 5000
27
 
28
- # Set the environment variable for Flask
29
- ENV FLASK_APP=app.py
30
 
31
- # Run the Flask application
32
- CMD ["flask", "run", "--host=0.0.0.0"]
33
- # FROM python:3.9
34
 
35
  # RUN useradd -m -u 1000 user
36
 
37
- # WORKDIR /app
38
-
39
  # COPY --chown=user ./requirements.txt requirements.txt
40
 
41
- # RUN pip install --no-cache-dir --upgrade -r requirements.txt
42
-
 
43
  # COPY --chown=user . /app
44
 
45
  # EXPOSE 5000
 
1
+ # FROM python:3.9
2
+ # WORKDIR /app
3
+ # COPY requirements.txt .
4
+ # RUN pip install --no-cache-dir -r requirements.txt
5
+ # RUN useradd -m -u 1000 user
6
+ # USER user
7
+ # ENV HOME=/home/user \
8
+ # PATH=/home/user/.local/bin:$PATH
9
+ # WORKDIR $HOME/app
10
+ # COPY --chown=user . $HOME/app
11
+ # EXPOSE 5000
12
+ # ENV FLASK_APP=app.py
13
+ # CMD ["flask", "run", "--host=0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
 
 
15
 
16
+ FROM python:3.9
 
 
17
 
18
  # RUN useradd -m -u 1000 user
19
 
20
+ WORKDIR /app
21
+ COPY ./requirements.txt requirements.txt
22
  # COPY --chown=user ./requirements.txt requirements.txt
23
 
24
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
25
+ COPY . .
26
+ CMD ["gunicorn", "--host", "0.0.0.0:7860", "main:app"]
27
  # COPY --chown=user . /app
28
 
29
  # EXPOSE 5000
app.py CHANGED
@@ -61,9 +61,9 @@ def generate_response(llm,prompt,pinecone_vector_store,question):
61
  @app.route("/")
62
  def index():
63
  print('Hello before chat html')
64
- return "<p>Hello, Team!</p>"
65
 
66
- # return render_template('chat.html')
67
 
68
  @app.route("/get", methods=["GET", "POST"])
69
  def chat():
 
61
  @app.route("/")
62
  def index():
63
  print('Hello before chat html')
64
+ # return "<p>Hello, Team!</p>"
65
 
66
+ return render_template('templates/chat.html')
67
 
68
  @app.route("/get", methods=["GET", "POST"])
69
  def chat():