From 0cb5382ac5feb3839c186484375b1db080d8582d Mon Sep 17 00:00:00 2001 From: sassar88 Date: Tue, 6 Dec 2022 11:00:11 +0100 Subject: [PATCH 1/3] * add docker config with a nginx * add a make script for easy startup * extend the readme to subscribe, how you can run with docker --- .dockerignore | 32 +++++++++++++++++++++++ .gitignore | 4 +++ Dockerfile | 7 ++++++ Makefile | 2 ++ README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ app.conf | 37 +++++++++++++++++++++++++++ launcher-macos | Bin 7 files changed, 149 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Makefile create mode 100755 app.conf mode change 100644 => 100755 launcher-macos diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..cd74655e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,32 @@ +debug.log +CORS.json +*.bat +dev/* + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build +/dist +/.idea +/.git + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* + +cardconjurer.iml +access.log +error.log diff --git a/.gitignore b/.gitignore index 8b834a40..713e044b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ dev/* npm-debug.log* yarn-debug.log* + +cardconjurer.iml +access.log +error.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0216fe5a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# syntax = docker/dockerfile:1.2 +FROM nginx:1.21-alpine as prod + +EXPOSE 4242 +COPY . /usr/share/nginx/html/ +COPY app.conf /etc/nginx/nginx.conf + diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..5475649e --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +start: + docker build -f Dockerfile --target "prod" . -t "cardconjurer-client" && docker run -dit -h 127.0.0.1 -p 4242:4242 "cardconjurer-client" diff --git a/README.md b/README.md index 4b7397db..38dfe9cb 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,70 @@ This repository is for the purpose of making the application usable on your loca [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?longCache=true&style=popout)](https://www.paypal.me/kyleburtondonate ) ← Help out Card Conjurer's original creator, Kyle. We love you buddy. + + +## Start with Docker + +
+ Install Make on Ubuntu + + ```bash + $ sudo apt update + ``` + + check is make installed + + ```bash + $ make -version + ``` + + after run this command, you got the following error? + + - **bash: /usr/bin/make: No such file or directory** + + then follow with the next step, otherwise skip the next commands + + ```bash + $ sudo apt install make + ``` + +### Troubleshooting's? + * Follow this guide https://linuxhint.com/install-make-ubuntu/ +
+ +
+ Install Make on Mac + + check is make installed + + ```bash + $ make -version + ``` + + after run this command, you got the following error? + + - **zsh: command not found: make** + + then follow with the next step, otherwise skip the next commands + + ```bash + $ (sudo) brew install make + ``` +
+ +
+ Install Make on Windows + + Follow this Guide + https://sp21.datastructur.es/materials/guides/make-install.html#windows-installation +
+ +* go to the downloaded/ cloned folder with your terminal/ powershell (windows) and run the following command + +```bash +$ make start +``` + +### Important + +Be sure, that you are running Docker Desktop under Windows or Mac before you can run the make command. diff --git a/app.conf b/app.conf new file mode 100755 index 00000000..be1b1b56 --- /dev/null +++ b/app.conf @@ -0,0 +1,37 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + + keepalive_timeout 65; + gzip on; + server { + listen 4242 default_server; + server_name localhost; + root /usr/share/nginx/html; + index index.html index.htm; + location ~* \.(?:manifest|appcache|html?|xml|json)$ { + expires -1; + } + location ~* \.(?:css|js)$ { + try_files $uri =404; + expires 1y; + access_log off; + add_header Cache-Control "public"; + } + # Any route containing a file extension (e.g. /devicesfile.js) + location ~ ^.+\..+$ { + try_files $uri =404; + } + # Any route that doesn't have a file extension (e.g. /devices) + location / { + try_files $uri $uri/ /index.html; + } + } +} diff --git a/launcher-macos b/launcher-macos old mode 100644 new mode 100755 From a04e88cc3d08559488b797bbede0410a9c2c6a4d Mon Sep 17 00:00:00 2001 From: sassar88 Date: Tue, 6 Dec 2022 11:12:45 +0100 Subject: [PATCH 2/3] add url --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 38dfe9cb..97e44669 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository is for the purpose of making the application usable on your loca ) ← Help out Card Conjurer's original creator, Kyle. We love you buddy. -## Start with Docker +## Start with Docker (http://localhost:4242/)
Install Make on Ubuntu @@ -74,6 +74,10 @@ This repository is for the purpose of making the application usable on your loca $ make start ``` +Open your Browser with the following URL + +http://localhost:4242/ + ### Important Be sure, that you are running Docker Desktop under Windows or Mac before you can run the make command. From 776647daa62fbbd81f444229335d255b1a35be2c Mon Sep 17 00:00:00 2001 From: sassar88 Date: Tue, 6 Dec 2022 11:20:21 +0100 Subject: [PATCH 3/3] remove executable --- launcher-macos | Bin 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 launcher-macos diff --git a/launcher-macos b/launcher-macos old mode 100755 new mode 100644