You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am finding that when I run npm run build in Docker, the filename hashes differ from what is in index.html, so nothing shows on browser. I'm not entirely sure how that is happening, since I don't believe I am doing anything different from local. The command runs fine in local.
The Docker file in questtion:
###########
# BUILDER #
###########
# pull official base image
FROM node:12.18.3-alpine3.9 as builder
# set work directory
WORKDIR /usr/src/app
# install dependencies and avoid `node-gyp rebuild` errors
COPY ./react_app/package.json .
RUN apk add --no-cache --virtual .gyp \
python \
make \
g++ \
&& npm install \
&& apk del .gyp
# copy our react project
COPY ./react_app .
# perform npm build
ARG API_SERVER
ENV REACT_APP_API_SERVER=${API_SERVER}
RUN REACT_APP_API_SERVER=${API_SERVER} \
npm run build
#########
# FINAL #
#########
# pull official base image
FROM node:12.18.3-alpine3.9
# set work directory
WORKDIR /usr/src/app
# install serve - deployment static server suggested by official create-react-app
RUN npm install -g serve
# copy our build files from our builder stage
COPY --from=builder /usr/src/app/build ./build
Do you know what would be points to check during debugging? I tried running the command ENV_API_SERVER=http://127.0.0.1 npm run build locally, and confirmed that the build dir and the artifact filenames have the right hash. Not sure what could be different in Docker.
The text was updated successfully, but these errors were encountered:
Hello,
I am loosely following the set up described here: https://www.datagraphi.com/blog/post/2020/8/30/docker-guide-build-a-fully-production-ready-machine-learning-app-with-react-django-and-postgresql-on-docker
I am finding that when I run
npm run build
in Docker, the filename hashes differ from what is inindex.html
, so nothing shows on browser. I'm not entirely sure how that is happening, since I don't believe I am doing anything different from local. The command runs fine in local.The Docker file in questtion:
Do you know what would be points to check during debugging? I tried running the command
ENV_API_SERVER=http://127.0.0.1 npm run build
locally, and confirmed that the build dir and the artifact filenames have the right hash. Not sure what could be different in Docker.The text was updated successfully, but these errors were encountered: