Skip to content

Commit

Permalink
fixed config.js replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Comand committed Oct 3, 2024
1 parent aaa0608 commit 16b5567
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV API_URL=http://localhost:8080
COPY ./ /usr/share/nginx/html

# Replace environment variables in config.js using envsubst
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/src/config.js > /usr/share/nginx/html/src/config.js && nginx -g 'daemon off;'"]
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/src/config.js > /usr/share/nginx/html/src/config.tmp && mv /usr/share/nginx/html/src/config.tmp /usr/share/nginx/html/src/config.js && nginx -g 'daemon off;'"]

# Expose the default Nginx port
EXPOSE 80
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const apiurl = '%%API_URL%%';
export const apiurl = '${API_URL}';

0 comments on commit 16b5567

Please sign in to comment.