0

[React App giving 404 on static js and css ]

I built a react app using "react-scripts". The application runs perfectly on my local development server but when I deploy to my actual server the applications seems to not find the main JS and CSS files being compiled. I get 404 on both.

this is my docker file :

FROM quay.io/keycloak/keycloak:20.0.5

COPY --from=builder /build/keycloak-ui/build /opt/keycloak/keycloak-ui

COPY --from=builder /build/keycloak-ui/build /opt/keycloak/themes/keycloak-ui

COPY --from=builder /build/keycloak-providers/target/marketplace-signup-keycloak-providers-jar-with-dependencies.jar /opt/keycloak/providers/marketplace-signup-keycloak-providers-jar-with-dependencies.jar

1 Answers1

0

Having deployed the static files on my reverse proxy, I found that the solution was to make the files accessible through any web server or CDN, since I couldn't deploy react project on the key-cloak 20, then I changed my key-cloak Docker to read the index page from the reverse proxy by the below command

RUN \
wget http://host.docker.internal:8090/keycloak-ui/index.html