Skip to content

Commit

Permalink
use env var for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay288 committed Aug 7, 2022
1 parent a46d403 commit 924d6e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions deploy/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN yarn
RUN yarn build

WORKDIR /usr/src/app/frontend
RUN echo 'BACKEND_URL=http://backend:8080' > .env
RUN yarn
RUN yarn build

Expand Down
3 changes: 2 additions & 1 deletion frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module.exports = {
async rewrites() {
var backendURL = process.env.BACKEND_URL || 'http://localhost:8080'
return [
{
source: "/api/:path*",
destination: "http://localhost:8080/api/:path*",
destination: `${backendURL}/api/:path*`,
},
];
},
Expand Down

0 comments on commit 924d6e6

Please sign in to comment.