From 5397f76747701bffa28a4b8ac3447ad28f4066f2 Mon Sep 17 00:00:00 2001 From: sid Date: Mon, 13 Aug 2018 15:41:03 +0530 Subject: [PATCH] integration with docker User may avoid local setup issues using docker. All you need to have docker and docker compose it relies on node:8-jessie image. --- Dockerfile | 2 ++ README.md | 8 ++++++++ docker-compose.yaml | 13 +++++++++++++ init.sh | 4 ++++ package.json | 1 + 5 files changed, 28 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml create mode 100755 init.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eeb7ec1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM node:8-jessie +RUN npm rebuild node-sass \ No newline at end of file diff --git a/README.md b/README.md index dd3dcea..9bb1361 100755 --- a/README.md +++ b/README.md @@ -39,6 +39,14 @@ Start by typing the following commands in your terminal in order to get **Admina > npm run dev ``` +#### Running with Docker +``` +> git clone https://github.com/puikinsh/Adminator-admin-dashboard.git adminator +> cd adminator +> docker-compose up --build +``` +browse [http://localhost:3000/](http://localhost:3000/) , we are good to go + ### Files/Folders Structure Here is a brief explanation of the template folder structure and some of its main files usage: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..1b48101 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +version: '3' +services: + ui: + build: + context: . + dockerfile: Dockerfile + command: "sh init.sh" + working_dir: /home/node/app + volumes: + - ${PWD}/:/home/node/app + container_name: ui + ports: + - 3000:3000 \ No newline at end of file diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..ce69601 --- /dev/null +++ b/init.sh @@ -0,0 +1,4 @@ +#!/bin/bash +git config --global url."https://".insteadOf git:// +npm install +npm run docker-dev \ No newline at end of file diff --git a/package.json b/package.json index 1b660d6..6a86efb 100755 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "start": "webpack-dev-server", "dev": "webpack-dashboard -t 'Project' -- webpack-dev-server", + "docker-dev": "webpack-dev-server", "clean": "shx rm -rf ./build", "build": "npm run clean && cross-env NODE_ENV=\"production\" webpack", "preview": "cross-env NODE_ENV=\"production\" webpack-dev-server",