m4k1-dev commited on
Commit
a3dc412
·
1 Parent(s): 4c7a799

container works now

Browse files
Files changed (4) hide show
  1. Dockerfile +3 -1
  2. app/app.py +3 -7
  3. docker-compose.yml +0 -2
  4. pyproject.toml +1 -1
Dockerfile CHANGED
@@ -24,4 +24,6 @@ RUN chown -R $USER_UID:$USER_GID /modelapi \
24
  # Change to the user and do subnet installation
25
  USER $USERNAME
26
 
27
- RUN /bin/bash -c "python3 -m venv /modelapi/.venv && source /modelapi/.venv/bin/activate && pip3 install -e /modelapi/."
 
 
 
24
  # Change to the user and do subnet installation
25
  USER $USERNAME
26
 
27
+ RUN /bin/bash -c "python3 -m venv /modelapi/.venv && source /modelapi/.venv/bin/activate && pip3 install -e /modelapi/."
28
+
29
+ RUN chown -R $USER_UID:$USER_GID /modelapi/.venv && chmod -R 755 /modelapi/.venv
app/app.py CHANGED
@@ -102,7 +102,7 @@ class modelapi:
102
  except:
103
  return fastapi.HTTPException(status_code=500, detail="An error occurred while fetching API status.")
104
 
105
- def upload_audio(self, files: List[fastapi.UploadFile] = File(...)):
106
  try:
107
  uploaded_files = []
108
 
@@ -160,9 +160,5 @@ class modelapi:
160
  raise fastapi.HTTPException(status_code=500, detail="An error occurred while creating the download file.")
161
 
162
  def run(self):
163
- threading.Thread(
164
- target=uvicorn.run,
165
- args=(self.app,),
166
- kwargs={"host":self.host, "port":self.port},
167
- daemon=True,
168
- ).start()
 
102
  except:
103
  return fastapi.HTTPException(status_code=500, detail="An error occurred while fetching API status.")
104
 
105
+ def upload_audio(self, files: List[fastapi.UploadFile] = fastapi.File(...)):
106
  try:
107
  uploaded_files = []
108
 
 
160
  raise fastapi.HTTPException(status_code=500, detail="An error occurred while creating the download file.")
161
 
162
  def run(self):
163
+
164
+ uvicorn.run(self.app, host=self.host, port=self.port)
 
 
 
 
docker-compose.yml CHANGED
@@ -9,6 +9,4 @@ services:
9
  USER_UID: 10002
10
  USER_GID: 10002
11
  USERNAME: modelapi
12
- volumes:
13
- - .:/modelapi
14
  command: /bin/bash -c "source /modelapi/.venv/bin/activate && python3 /modelapi/app/run.py"
 
9
  USER_UID: 10002
10
  USER_GID: 10002
11
  USERNAME: modelapi
 
 
12
  command: /bin/bash -c "source /modelapi/.venv/bin/activate && python3 /modelapi/app/run.py"
pyproject.toml CHANGED
@@ -25,7 +25,7 @@ classifiers = [
25
  requires-python = ">=3.10,<3.12"
26
 
27
  dependencies = [
28
- "fastapi==0.115.5", "uvicorn==0.32.0",
29
  ]
30
 
31
  [tool.setuptools.packages.find]
 
25
  requires-python = ">=3.10,<3.12"
26
 
27
  dependencies = [
28
+ "fastapi==0.115.5", "uvicorn==0.32.0", "python-multipart==0.0.17"
29
  ]
30
 
31
  [tool.setuptools.packages.find]