Spaces:
Sleeping
Sleeping
fix dockerfile permission denied
Browse files- Dockerfile +10 -1
- app.py +1 -1
- compose.yml +9 -0
Dockerfile
CHANGED
@@ -10,7 +10,16 @@ COPY . .
|
|
10 |
# Install requirements.txt
|
11 |
RUN pip install -r requirements.txt
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
EXPOSE 7860
|
14 |
|
15 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
16 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
10 |
# Install requirements.txt
|
11 |
RUN pip install -r requirements.txt
|
12 |
|
13 |
+
RUN useradd -m -u 1000 user
|
14 |
+
USER user
|
15 |
+
ENV HOME=/home/user \
|
16 |
+
PATH=/home/user/.local/bin:$PATH
|
17 |
+
|
18 |
+
WORKDIR $HOME/app
|
19 |
+
|
20 |
+
COPY --chown=user . $HOME/app
|
21 |
+
|
22 |
EXPOSE 7860
|
23 |
|
24 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
25 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
|
app.py
CHANGED
@@ -15,7 +15,7 @@ app.include_router(get_transcript.router)
|
|
15 |
|
16 |
@app.get("/")
|
17 |
def read_root():
|
18 |
-
return {"message": "This is from python backend cache"}
|
19 |
|
20 |
if __name__ == '__main__':
|
21 |
uvicorn.run(
|
|
|
15 |
|
16 |
@app.get("/")
|
17 |
def read_root():
|
18 |
+
return {"message": "This is from python backend cache... test here"}
|
19 |
|
20 |
if __name__ == '__main__':
|
21 |
uvicorn.run(
|
compose.yml
CHANGED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: "3"
|
2 |
+
|
3 |
+
services:
|
4 |
+
web:
|
5 |
+
build: .
|
6 |
+
ports:
|
7 |
+
- 8000:7860
|
8 |
+
volumes:
|
9 |
+
- .:/app
|