FROM node:4-stretch
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>

# Create motepair user
RUN useradd motepair -md /opt/motepair
WORKDIR /opt/motepair
USER motepair

# Install motepair
RUN git clone --depth 1 https://github.com/motepair/motepair-server
WORKDIR /opt/motepair/motepair-server
RUN npm install

# TCP port of motepair
EXPOSE 3000

# Run motepair
CMD ["node", "target/server.js"]
