Muhammad Abdur Rahman Saad commited on
Commit
a7455ea
·
1 Parent(s): eeee6ef

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image with Python 3.10
2
+ FROM python:3.10-slim
3
+
4
+ # Create a non-root user and change ownership
5
+ RUN useradd -m -u 1000 user
6
+ WORKDIR /app
7
+ COPY --chown=user . /app
8
+
9
+ # Install any needed packages specified in requirements.txt
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+ RUN pip uninstall transformers -y
12
+ RUN pip install transformers tensorflow tf-keras python-dotenv astrapy langchain-community
13
+
14
+ # Make port 7860 available to the world outside this container
15
+ EXPOSE 7860
16
+
17
+ # Define environment variable
18
+ ENV FLASK_APP=app
19
+ ENV FLASK_RUN_HOST=0.0.0.0
20
+ ENV FLASK_RUN_PORT=7860
21
+ ENV FLASK_ENV=development
22
+
23
+ # Run gunicorn command when the container launches
24
+ # CMD ["gunicorn", "-t", "120", "-w", "4", "app:app"]
25
+ CMD ["uvicorn", "app:asgi_app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "120"]