Files
cgm-remote-monitor/Dockerfile.example
T
Oskar Pearson 65428aab7c Build docker images with Travis
- Add Docker hub secrets to Travis
- Push to Docker Hub
- Ignore .git directory and things like coverage logs, so as to minimise
  the container size

I placed the Docker hub login commands in the commands in the .travis.yml file,
rather than in the Makefile. This is because the Makefile would display the
Docker password to stdout, which would then become publically available in the
Travis logs.

I also run `git clean -fd .` and `git checkout -- .` to ensure that anything
written to the repo directory during tests isn't added to the docker container.
I do this in the Travis file rather than the Makefile, since running things with
`make` reverted my changes while experimenting, and I want to save others the
same issue.

To make this work on Travis, we need to set secrets for the DOCKER_USER and
DOCKER_PASS environment variable.
2017-02-11 01:43:09 +00:00

25 lines
394 B
Docker

FROM node:0.12
MAINTAINER Nightscout Contributors
RUN apt-get update && \
apt-get -y dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
nodejs \
nodejs-legacy \
npm && \
apt-get -y clean
RUN mkdir -p /opt/app
ADD . /opt/app
WORKDIR /opt/app
RUN npm install && \
npm run postinstall && \
npm run env
EXPOSE 1337
CMD ["node", "server.js"]