Skip to content

Commit

Permalink
add parameter to build docker container in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Sep 20, 2021
1 parent 63bf7ac commit 9adc9bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 9adc9bc

Please sign in to comment.