From cbc1609ad457aa43d9f3221b16bf095d103571c8 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 10 Oct 2019 17:03:18 +0200 Subject: [PATCH] Added docker compose --- Dockerfile | 11 +++++++++++ docker-compose.yml | 15 +++++++++++++++ package-lock.json | 6 +++--- package.json | 4 +++- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8921906 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:current-alpine + +COPY . /home/node/green +WORKDIR /home/node/green +RUN npm install -g gulp +RUN npm install --save-dev +RUN npm rebuild node-sass +RUN gulp +COPY . . +EXPOSE 8080 +CMD ["npm" , "run"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b321777 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: "2" +services: + greenvironment: + build: + context: . + dockerfile: ./Dockerfile + user: "node" + working_dir: /home/node/green + environment: + - NODE_ENV=production + volumes: + - ./:/home/node/green + expose: + - "8080" + command: "npm start" diff --git a/package-lock.json b/package-lock.json index 7a07454..9142d18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6934,9 +6934,9 @@ "dev": true }, "type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz", - "integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, "type-is": { diff --git a/package.json b/package.json index 52e9130..215b8cd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "Server for greenvironment network", "main": "./dist/index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "gulp", + "start": "node ./dist/index.js" }, "repository": { "type": "git",