Mbonea commited on
Commit
c17ee23
1 Parent(s): 704680a

added app file and made changes to dockerfile

Browse files
Files changed (3) hide show
  1. .vscode/settings.json +7 -1
  2. Dockerfile +0 -3
  3. app.py +16 -0
.vscode/settings.json CHANGED
@@ -1,3 +1,9 @@
1
  {
2
- "cSpell.words": ["websockets"]
 
 
 
 
 
 
3
  }
 
1
  {
2
+ "cSpell.words": [
3
+ "websockets"
4
+ ],
5
+ "[python]": {
6
+ "editor.defaultFormatter": "ms-python.black-formatter"
7
+ },
8
+ "python.formatting.provider": "none"
9
  }
Dockerfile CHANGED
@@ -14,7 +14,4 @@ RUN pip install --no-cache-dir -r requirements.txt
14
 
15
  COPY . /srv
16
 
17
-
18
-
19
- CMD uvicorn App.app:app --host 0.0.0.0 --port 7860 & celery -A App.Worker.celery worker -c 1 --loglevel=info
20
  EXPOSE 7860
 
14
 
15
  COPY . /srv
16
 
 
 
 
17
  EXPOSE 7860
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+
3
+
4
+ def run_command(command):
5
+ try:
6
+ output = subprocess.check_output(
7
+ command, shell=True, stderr=subprocess.STDOUT, universal_newlines=True)
8
+ print(output)
9
+ except subprocess.CalledProcessError as e:
10
+ print(
11
+ f"Command execution failed with return code {e.returncode}: {e.output}")
12
+
13
+
14
+ # Example usage
15
+ command = "uvicorn App.app:app --host 0.0.0.0 --port 7860 & celery -A App.Worker.celery worker -c 1 --loglevel=info"
16
+ run_command(command)