diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..eac633f69 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..cb95d40b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM nginx:alpine + +RUN chown -R nginx:nginx /var/log/nginx \ + && chown -R nginx:nginx /etc/nginx/nginx.conf + + +COPY nginx.conf /etc/nginx/nginx.conf +COPY ./angular/dist/angular-starter /var/www/html + + +EXPOSE 80 diff --git a/README.md b/README.md index ac7c21c25..80a963b20 100644 --- a/README.md +++ b/README.md @@ -162,3 +162,4 @@ Here is a step by step Tutorial : https://www.ganatan.com/tutorials/getting-sta - Installation - https://www.ganatan.com/tutorials/demarrer-avec-angular - Tutoriels Etape par étape - https://www.ganatan.com/tutorials +"# angular-react-starter-ex" diff --git a/angular/angular.json b/angular/angular.json index a793f76c4..c00948b27 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -112,6 +112,7 @@ } }, "cli": { - "defaultCollection": "@angular-eslint/schematics" + "defaultCollection": "@angular-eslint/schematics", + "analytics": "74d2ecca-b905-4459-b7d8-89e9b09546c8" } } diff --git a/angular/nginx.conf b/angular/nginx.conf index ca9adbf52..60edf1baa 100644 --- a/angular/nginx.conf +++ b/angular/nginx.conf @@ -1,4 +1,4 @@ -user www-data; +user nobody; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; @@ -27,8 +27,8 @@ http { include /etc/nginx/conf.d/*.conf; server { - listen 80 default_server; - listen [::]:80 default_server; + listen 8080 default_server; + listen [::]:8080 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html; diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000..f82e77a00 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,44 @@ +user nginx; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; +} + +http { + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE + ssl_prefer_server_ciphers on; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + gzip on; + + include /etc/nginx/conf.d/*.conf; + + server { + listen 80 default_server; + listen [::]:80 default_server; + root /var/www/html; + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + try_files $uri $uri/ =404; + } + + } + +} +