From de8a133cfce509329fe9bdcdb61d1b4093683572 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 27 May 2018 16:47:12 -0400 Subject: [PATCH] Containterise application --- Dockerfile | 8 ++++---- docker-compose.yml | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c253a9d2..2b6fb927 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ FROM node:8.11-alpine +# Set up our workspace +WORKDIR /usr/app + # Install app dependencies COPY package.json . -RUN npm install +RUN npm install --quiet # App source COPY . . # Ports EXPOSE 3000 - -# Commands (not for prodcution) -CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e4eb536f..3486883b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,5 +5,12 @@ services: build: . image: electic-io container_name: electric-io + command: npm run start ports: - - 3000:3000 \ No newline at end of file + - 3000:3000 + volumes: # For file editing, watching, etc + - ./public:/usr/app/public + - ./lib:/usr/app/lib + - ./.data/dashboard.json.sim:/usr/app/.data/dashboard.json.sim + - ./.config:/usr/app/.config + - ./index.js:/usr/app/index.js \ No newline at end of file