Skip to content

Commit ba3e600

Browse files
author
Harmanpreet Kaur
committed
updated app.py and dockerfile
1 parent fd5dda9 commit ba3e600

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

App/WebApp.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \
3434
COPY . /usr/src/app/
3535

3636
# Copy static files from the frontend stage to the backend
37+
COPY --from=frontend /home/node/app/frontend/build /usr/src/app/build/
3738
COPY --from=frontend /home/node/app/frontend/build/static /usr/src/app/static/
3839

3940
# Set working directory and expose port

App/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@
3434
@app.route("/")
3535
async def serve_index():
3636
return await send_from_directory(
37-
os.path.join(app.root_path, "frontend", "build"), "index.html"
37+
os.path.join(app.root_path,"build"), "index.html"
3838
)
3939

4040

4141
@app.route("/favicon.ico")
4242
async def favicon():
4343
return await send_from_directory(
44-
os.path.join(app.root_path, "frontend", "build", "static"),
44+
os.path.join(app.root_path,"build"),
4545
"favicon.ico",
4646
mimetype="image/x-icon",
4747
)
4848

4949

5050
# Serve static files (JS, CSS, images, etc.)
51-
@app.route("/assets/<path:path>")
51+
@app.route("/static/<path:path>")
5252
async def assets(path):
5353
return await send_from_directory(
54-
os.path.join(app.root_path, "frontend", "build", "static", "assets"), path
54+
os.path.join(app.root_path, "static"), path
5555
)
5656

5757

0 commit comments

Comments
 (0)