dillonlaird commited on
Commit
5a65991
1 Parent(s): a3ebaa7

fix permissions and file location issues

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -0
  2. app/main.py +3 -2
Dockerfile CHANGED
@@ -20,5 +20,7 @@ COPY --chown=user . $HOME/app
20
  WORKDIR $HOME/app/instance-labeler
21
  RUN yarn install && yarn build
22
 
 
 
23
 
24
  CMD ["/code/.venv/bin/python3", "main.py"]
 
20
  WORKDIR $HOME/app/instance-labeler
21
  RUN yarn install && yarn build
22
 
23
+ WORKDIR $HOME/app
24
+
25
 
26
  CMD ["/code/.venv/bin/python3", "main.py"]
app/main.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import io
2
  import base64
3
  import numpy as np
@@ -93,7 +94,7 @@ class ImageData(BaseModel):
93
 
94
  @app.get("/")
95
  async def index():
96
- return FileResponse(path="/app/instance-labeler/out/index.html", media_type="text/html")
97
 
98
 
99
  @app.post("/v1/get_label_preds/{image}")
@@ -275,4 +276,4 @@ async def get_all_images() -> Response:
275
  return JSONResponse(content={"images": DATA.get_all_images()})
276
 
277
 
278
- app.mount("/", StaticFiles(directory="/app/instance-labeler/out", html=True), name="static")
 
1
+ import os
2
  import io
3
  import base64
4
  import numpy as np
 
94
 
95
  @app.get("/")
96
  async def index():
97
+ return FileResponse(path=f"{os.environ['HOME']}/app/instance-labeler/out/index.html", media_type="text/html")
98
 
99
 
100
  @app.post("/v1/get_label_preds/{image}")
 
276
  return JSONResponse(content={"images": DATA.get_all_images()})
277
 
278
 
279
+ app.mount("/", StaticFiles(directory=f"{os.environ['HOME']}/app/instance-labeler/out", html=True), name="static")