From c6b9ecc058f19ba02e901f643f7134920d7cdaf8 Mon Sep 17 00:00:00 2001 From: Patrick Bashizi Date: Thu, 5 Jan 2023 14:02:10 +0100 Subject: [PATCH 1/3] setup Containerization --- .dockerignore | 9 +++++++++ .vscode/settings.json | 3 ++- Dockerfile | 13 +++++++++++++ angular.json | 3 +++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..420288ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +.gitignore +node_modules +npm-debug.log +Dockerfile* +docker-compose* +README.md +LICENSE +.vscode \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a90bead..d4d153b0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "typescript.tsdk": "./node_modules/typescript/lib", - "tslint.enable": false + "tslint.enable": false, + "angular.enable-strict-mode-prompt": false } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..37d902ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# Stage 1 +FROM node:14.15.0 as node +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build --prod +# Stage 2 +FROM nginx:alpine +COPY --from=node /app/dist /usr/share/nginx/html + + +# docker run -d -it -p 80:80/tcp --name ngx-admin bashizip/ngx-admin:latest +# docker exec -it 79fb3f7d6f9d /bin/sh \ No newline at end of file diff --git a/angular.json b/angular.json index d9a98ba4..1069a260 100644 --- a/angular.json +++ b/angular.json @@ -182,5 +182,8 @@ "@schematics/angular:directive": { "prefix": "ngx" } + }, + "cli": { + "analytics": "6ceaf63a-1fd9-4b47-8f92-86ee6131896a" } } From 66840dfd4efa0feb896e2fc8857fe09cf170682b Mon Sep 17 00:00:00 2001 From: Patrick Bashizi Date: Thu, 5 Jan 2023 14:12:36 +0100 Subject: [PATCH 2/3] updated readme --- Dockerfile | 2 -- README.md | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 37d902ac..0af0caea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,3 @@ FROM nginx:alpine COPY --from=node /app/dist /usr/share/nginx/html -# docker run -d -it -p 80:80/tcp --name ngx-admin bashizip/ngx-admin:latest -# docker exec -it 79fb3f7d6f9d /bin/sh \ No newline at end of file diff --git a/README.md b/README.md index 981c3315..c922d8f7 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ To install ngx-admin you have to use NodeJS version 14.14+ because of [node-sass](https://github.com/sass/node-sass) version utilized in the application. +# Docker + +You can now build your own image and run it on Docker + # Material theme for ngx-admin Material admin theme is based on the most popular Angular dashboard template - [ngx-admin](https://akveo.github.io/ngx-admin?utm_campaign=ngx_admin%20-%20home%20-%20ngx_admin%20github%20readme&utm_source=ngx_admin_material&utm_medium=referral&utm_content=github_readme) From 50f4d47e085f654482cbfa91d3eacac4ed199902 Mon Sep 17 00:00:00 2001 From: Patrick Bashizi Date: Thu, 5 Jan 2023 14:25:55 +0100 Subject: [PATCH 3/3] cleanups --- .vscode/settings.json | 1 - angular.json | 3 --- 2 files changed, 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d4d153b0..18e5a12c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { "typescript.tsdk": "./node_modules/typescript/lib", "tslint.enable": false, - "angular.enable-strict-mode-prompt": false } diff --git a/angular.json b/angular.json index 1069a260..d9a98ba4 100644 --- a/angular.json +++ b/angular.json @@ -182,8 +182,5 @@ "@schematics/angular:directive": { "prefix": "ngx" } - }, - "cli": { - "analytics": "6ceaf63a-1fd9-4b47-8f92-86ee6131896a" } }