diff --git a/Dockerfile.nginx b/Dockerfile.nginx new file mode 100644 index 00000000..9df0d07f --- /dev/null +++ b/Dockerfile.nginx @@ -0,0 +1,20 @@ +FROM node:20-alpine AS build-env + +WORKDIR /home/node/app + +RUN chown -R node:node /home/node/app + +USER node + +COPY package*.json ./ + +COPY --chown=node:node . . +RUN yarn install +ENV NODE_ENV=production +# if you want to use your own meilisearch server, you can set the following env +# ENV REACT_APP_MEILI_SERVER_ADDRESS=http://meilisearch:7700 +# ENV REACT_APP_MEILI_API_KEY=masterKey +RUN yarn build + +FROM nginx +COPY --from=build-env /home/node/app/build/ /usr/share/nginx/html/ diff --git a/README.md b/README.md index e42952a6..41b6e2ff 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,19 @@ docker build -t meilisearch-mini-dashboard . docker run -it -e REACT_APP_MEILI_SERVER_ADDRESS=http://localhost:7700 -p 3000:3000 meilisearch-mini-dashboard ``` +You can then access the mini-dashboard at `http://localhost:3000`. + +## Docker with Nginx +nginx is also available in the Docker image. You can use it to serve the mini-dashboard. + +```bash +docker build --build-arg REACT_APP_MEILI_SERVER_ADDRESS=http://meilisearch:7700 -t meilisearch-mini-dashboard-nginx . -f Dockerfile.nginx +docker run -p 8080:80 meilisearch-mini-dashboard-nginx +``` + +You can then access the mini-dashboard at `http://localhost:8080`. + + ## Contributing If you want to contribute to this project, please make sure to read [the contributing guidelines](./CONTRIBUTING.md)