From ba236e5560a024d23db2870d292a6d2df5fc6c76 Mon Sep 17 00:00:00 2001
From: Edwin Betancourt <EdwinBetanc0urt@hotmail.com>
Date: Fri, 5 Jun 2020 16:59:19 -0400
Subject: [PATCH] feat: Add run production mode with docker-compose.

---
 .dockerignore       | 24 ++++++++++++++++++++++++
 Dockerfile          | 17 +++++++++++++++++
 docker-compose.yaml | 20 ++++++++++++++++++++
 3 files changed, 61 insertions(+)
 create mode 100644 .dockerignore
 create mode 100644 Dockerfile
 create mode 100644 docker-compose.yaml

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..bb964a14
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,24 @@
+.DS_Store
+node_modules/
+vendor/
+dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+
+package-lock.json
+yarn.lock
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..3fe7954f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,17 @@
+FROM node:10
+
+# Create app directory
+WORKDIR /usr/app
+
+# Copy project files
+COPY . ./
+
+# Install app dependencies
+# A wildcard is used to ensure both package.json AND package-lock.json are copied
+# where available (npm@5+)
+RUN npm install \
+    && npm run build:prod
+# Build state files
+
+# Start builded application
+CMD npm run preview
diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 00000000..ce6dc517
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,20 @@
+version: '3.7'
+
+services:
+  web-client:
+    build:
+      context: .
+      dockerfile: ./Dockerfile
+    container_name: vue-element-admin
+    network_mode: bridge
+    build: .
+    volumes:
+      - /usr/app/
+      - /usr/app/node_modules
+    labels:
+      - app=vue-element-admin
+    stdin_open: true
+    tty: true
+    ports:
+      - 9526:9526 # Prod
+      # - 9527:9527 # Dev