marquesafonso
commited on
Commit
·
08dffe9
1
Parent(s):
00936bf
fix env variable issue
Browse files- Dockerfile +1 -2
- docker-compose.yml +2 -2
- main.py +0 -24
Dockerfile
CHANGED
@@ -14,8 +14,7 @@ RUN apt-get update && apt-get install -y imagemagick && sed -i '91d' /etc/ImageM
|
|
14 |
# Install any needed packages specified in requirements.txt
|
15 |
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
|
17 |
-
|
18 |
-
EXPOSE 7680
|
19 |
|
20 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
21 |
|
|
|
14 |
# Install any needed packages specified in requirements.txt
|
15 |
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
|
17 |
+
EXPOSE 7860
|
|
|
18 |
|
19 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
20 |
|
docker-compose.yml
CHANGED
@@ -4,6 +4,6 @@ services:
|
|
4 |
context: .
|
5 |
dockerfile: Dockerfile
|
6 |
ports:
|
7 |
-
- "
|
8 |
volumes:
|
9 |
-
- .:/app
|
|
|
4 |
context: .
|
5 |
dockerfile: Dockerfile
|
6 |
ports:
|
7 |
+
- "7860:7860"
|
8 |
volumes:
|
9 |
+
- .:/app
|
main.py
CHANGED
@@ -10,36 +10,12 @@ from fastapi.responses import HTMLResponse, Response
|
|
10 |
from fastapi.security import HTTPBasic
|
11 |
from pydantic import BaseModel, field_validator
|
12 |
|
13 |
-
# TODO: fix error with validation(possibly)
|
14 |
-
|
15 |
app = FastAPI()
|
16 |
security = HTTPBasic()
|
17 |
|
18 |
-
# class MP4Video(BaseModel):
|
19 |
-
# video_file: UploadFile
|
20 |
-
|
21 |
-
# @property
|
22 |
-
# def filename(self):
|
23 |
-
# return self.video_file.filename
|
24 |
-
# @property
|
25 |
-
# def file(self):
|
26 |
-
# return self.video_file.file
|
27 |
-
|
28 |
-
# # @field_validator('video_file')
|
29 |
-
# # def validate_video_file(cls, v):
|
30 |
-
# # if "video/" not in v.content_type:
|
31 |
-
# # raise HTTPException(status_code=500, detail='Invalid video file type. Please upload an MP4 file.')
|
32 |
-
# # return v
|
33 |
-
|
34 |
class SRTFile(BaseModel):
|
35 |
srt_file: Optional[UploadFile] = None
|
36 |
|
37 |
-
@property
|
38 |
-
def filename(self):
|
39 |
-
return self.srt_file.filename
|
40 |
-
@property
|
41 |
-
def file(self):
|
42 |
-
return self.srt_file.file
|
43 |
@property
|
44 |
def size(self):
|
45 |
return self.srt_file.size
|
|
|
10 |
from fastapi.security import HTTPBasic
|
11 |
from pydantic import BaseModel, field_validator
|
12 |
|
|
|
|
|
13 |
app = FastAPI()
|
14 |
security = HTTPBasic()
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
class SRTFile(BaseModel):
|
17 |
srt_file: Optional[UploadFile] = None
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
@property
|
20 |
def size(self):
|
21 |
return self.srt_file.size
|