kreations04 commited on
Commit
75ed29a
·
1 Parent(s): 9fe0d5f

application file added

Browse files
Files changed (6) hide show
  1. .dockerignore +27 -0
  2. .vscode/launch.json +19 -0
  3. .vscode/tasks.json +33 -0
  4. Dockerfile +25 -0
  5. app.py +0 -0
  6. requirements.txt +2 -0
.dockerignore ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ **/__pycache__
2
+ **/.venv
3
+ **/.classpath
4
+ **/.dockerignore
5
+ **/.env
6
+ **/.git
7
+ **/.gitignore
8
+ **/.project
9
+ **/.settings
10
+ **/.toolstarget
11
+ **/.vs
12
+ **/.vscode
13
+ **/*.*proj.user
14
+ **/*.dbmdl
15
+ **/*.jfm
16
+ **/bin
17
+ **/charts
18
+ **/docker-compose*
19
+ **/compose*
20
+ **/Dockerfile*
21
+ **/node_modules
22
+ **/npm-debug.log
23
+ **/obj
24
+ **/secrets.dev.yaml
25
+ **/values.dev.yaml
26
+ LICENSE
27
+ README.md
.vscode/launch.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "configurations": [
3
+ {
4
+ "name": "Containers: Python - Fastapi",
5
+ "type": "docker",
6
+ "request": "launch",
7
+ "preLaunchTask": "docker-run: debug",
8
+ "python": {
9
+ "pathMappings": [
10
+ {
11
+ "localRoot": "${workspaceFolder}",
12
+ "remoteRoot": "/app"
13
+ }
14
+ ],
15
+ "projectType": "fastapi"
16
+ }
17
+ }
18
+ ]
19
+ }
.vscode/tasks.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "type": "docker-build",
6
+ "label": "docker-build",
7
+ "platform": "python",
8
+ "dockerBuild": {
9
+ "tag": "hostllm:latest",
10
+ "dockerfile": "${workspaceFolder}/Dockerfile",
11
+ "context": "${workspaceFolder}",
12
+ "pull": true
13
+ }
14
+ },
15
+ {
16
+ "type": "docker-run",
17
+ "label": "docker-run: debug",
18
+ "dependsOn": [
19
+ "docker-build"
20
+ ],
21
+ "python": {
22
+ "args": [
23
+ "app:app",
24
+ "--host",
25
+ "0.0.0.0",
26
+ "--port",
27
+ "7860"
28
+ ],
29
+ "module": "uvicorn"
30
+ }
31
+ }
32
+ ]
33
+ }
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # For more information, please refer to https://aka.ms/vscode-docker-python
2
+ FROM python:3-slim
3
+
4
+ EXPOSE 7860
5
+
6
+ # Keeps Python from generating .pyc files in the container
7
+ ENV PYTHONDONTWRITEBYTECODE=1
8
+
9
+ # Turns off buffering for easier container logging
10
+ ENV PYTHONUNBUFFERED=1
11
+
12
+ # Install pip requirements
13
+ COPY requirements.txt .
14
+ RUN python -m pip install -r requirements.txt
15
+
16
+ WORKDIR /app
17
+ COPY . /app
18
+
19
+ # Creates a non-root user with an explicit UID and adds permission to access the /app folder
20
+ # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
21
+ RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
22
+ USER appuser
23
+
24
+ # During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
25
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
app.py ADDED
File without changes
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastapi
2
+ uvicorn[standard]