diff --git a/Dockerfile b/Dockerfile index 93cc85f16..93c54311a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,20 @@ # DESCRIPTION: publicbodies.org website # BUILD: docker build --rm -t publicbodies . # -# If you want to just build the documentation portal locally, do: -# docker build --rm -t publicbodies . +# If you want to build the portal locally in development mode, do: +# docker build --rm -t publicbodies . --build-arg NODE_ENV=development # to build the container, then run # docker run --rm --name publicbodies -p 3000:3000 -it publicbodies node index.js # open http://localhost:3000 on your browser to see the portal. FROM node:12 +ARG NODE_ENV=production + # Never prompt the user for choices on installation/configuration of packages ENV DEBIAN_FRONTEND noninteractive ENV TERM linux -ENV NODE_ENV=production +ENV NODE_ENV=$NODE_ENV # from https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#global-npm-dependencies ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV PATH=$PATH:/home/node/.npm-global/bin diff --git a/README.md b/README.md index 4f50ad021..af5bd7c82 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ The website is a node webapp. To get it running: ``` docker build --rm -t publicbodies . ``` + + If you are building a development environment, please use: + + ``` + docker build --rm -t publicbodies . --build-arg NODE_ENV=development + ``` + so that you can get debugging information. 4. Run the webapp: