Jaime Ramírez
2020-06-03 8b401ce6cb754d4cde758d5d96cffc28d3456331
Fixed dockerfile copy
2 files modified
25 ■■■■■ changed files
adopt-a-pup/web-app/Dockerfile 23 ●●●●● patch | view | raw | blame | history
adopt-a-pup/web-app/server.js 2 ●●● patch | view | raw | blame | history
adopt-a-pup/web-app/Dockerfile
@@ -1,20 +1,25 @@
FROM registry.access.redhat.com/ubi8/nodejs-12
ENV REACT_APP_ADOPTION_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
    REACT_APP_ANIMAL_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
    REACT_APP_SHELTER_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
    REACT_APP_NEWS_ENABLED=1 \
    REACT_APP_NEWS_SERVICE_URL=http://locahost:5000/
# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci --production
# Copy app
COPY build server.js ./
COPY build ./build/
COPY server.js ./
# ENV REACT_APP_ADOPTION_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
#     REACT_APP_ANIMAL_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
#     REACT_APP_SHELTER_SERVICE_URL=http://envoy-gateway-adopt-a-pup.apps.ocp-jaime.do328.dev.nextcle.com/ \
#     REACT_APP_NEWS_ENABLED=1 \
#     REACT_APP_NEWS_SERVICE_URL=http://news-comprehensive-review-news.apps.ocp4.example.com
ENV REACT_APP_ADOPTION_SERVICE_URL=http://istio-ingressgateway-istio-system.apps.ocp4.example.com/ \
    REACT_APP_ANIMAL_SERVICE_URL=http://istio-ingressgateway-istio-system.apps.ocp4.example.com/ \
    REACT_APP_SHELTER_SERVICE_URL=http://istio-ingressgateway-istio-system.apps.ocp4.example.com/ \
    REACT_APP_NEWS_ENABLED=1 \
    REACT_APP_NEWS_SERVICE_URL=http://news-comprehensive-review-news.apps.ocp4.example.com
EXPOSE 8080
# Default run command
CMD [ "npm", "run", "start:prod" ]
adopt-a-pup/web-app/server.js
@@ -15,9 +15,9 @@
// Return index.html, with injected env variables
const indexFilePath = path.join(__dirname, "build", "index.html");
app.get("/*", async(request, response) => {
    log(request);
    const content = await injectEnvironmentInHTml(indexFilePath);
    response.send(content);
    log(request);
});