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..97e44669 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,74 @@ 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 (http://localhost:4242/) + +
+ 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 +``` + +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. 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; + } + } +}