diff --git a/.dockerignore b/.dockerignore index f5c367645..c53905088 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,4 @@ *.md !README.md **/node_modules -**/db/demo-db +**/db/demo-db \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fe38da15d..972ab01ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,14 @@ FROM node:lts-bullseye-slim as clientBuilder -ENV NODE_ENV "production" ENV NODE_OPTIONS=--openssl-legacy-provider RUN mkdir /app WORKDIR /app COPY client/package.json . COPY client/package-lock.json . -RUN npm ci --legacy-peer-deps +RUN npm ci COPY client . - +ENV NODE_ENV "production" RUN npm run build RUN echo package.json @@ -44,7 +43,7 @@ RUN npm ci --quiet COPY --from=serverBuilder /usr/src/app/build ./ COPY ./server/uploads ./uploads -COPY --from=clientBuilder /app/build ./client/build +COPY --from=clientBuilder app/dist ./client/build # we don't want to run as sudo so create group and user RUN groupadd -r fola && useradd --no-log-init -r -g fola fola diff --git a/client/.env b/client/.env index dca04956a..18eee026f 100644 --- a/client/.env +++ b/client/.env @@ -1,3 +1,3 @@ -REACT_APP_TENANT_ID=1 -REACT_APP_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoibHVjYXNob21lciIsImEiOiJjazFqcnRjcm0wNmZ1M2JwZXg2eDFzMXd3In0.yYpkKLrFCxF-qyBfZH1a8w +VITE_TENANT_ID=1 +VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoibHVjYXNob21lciIsImEiOiJjazFqcnRjcm0wNmZ1M2JwZXg2eDFzMXd3In0.yYpkKLrFCxF-qyBfZH1a8w SKIP_PREFLIGHT_CHECK=true \ No newline at end of file diff --git a/client/__mocks__/fileMock.js b/client/__mocks__/fileMock.js new file mode 100644 index 000000000..0a445d060 --- /dev/null +++ b/client/__mocks__/fileMock.js @@ -0,0 +1 @@ +module.exports = "test-file-stub"; diff --git a/client/__mocks__/styleMock.js b/client/__mocks__/styleMock.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/client/__mocks__/styleMock.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/client/babel.config.json b/client/babel.config.json new file mode 100644 index 000000000..965dc02cb --- /dev/null +++ b/client/babel.config.json @@ -0,0 +1,13 @@ +{ + "presets": [ + ["@babel/preset-env", { "targets": { "node": "current" } }], + ["@babel/preset-react", { "runtime": "automatic" }], + [ + "babel-preset-vite", + { + "env": true, + "glob": false + } + ] + ] +} diff --git a/client/craco.config.js b/client/craco.config.js deleted file mode 100644 index a73f6c3e4..000000000 --- a/client/craco.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - babel: { - loaderOptions: { - ignore: ["./node_modules/mapbox-gl/dist/mapbox-gl.js"], - }, - }, -}; diff --git a/client/public/index.html b/client/index.html similarity index 79% rename from client/public/index.html rename to client/index.html index 70522c8e7..41c3ffcf3 100644 --- a/client/public/index.html +++ b/client/index.html @@ -1,14 +1,14 @@
- + - + @@ -17,7 +17,7 @@ content="Food Oasis is a non-profit, volunteer-run directory of free food resources in the Los Angeles area." /> - + - - +