From c0b0ef28fdef2bde9f8cc05f16d9e092977b92a5 Mon Sep 17 00:00:00 2001 From: "Peter.Morton" Date: Fri, 25 Aug 2023 11:26:58 -0500 Subject: [PATCH] Added Docker information --- Dockerfile | 8 ++++++++ docker-bake.hcl | 16 ++++++++++++++++ docker-compose.yml | 25 +++++++++++++++++++++++++ gulpfile.js | 2 +- nginx.conf | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-bake.hcl create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..31a0ff6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +# production stage +FROM nginx:stable-alpine as production-stage +WORKDIR /app +COPY iframe_api_v2.html /app/iframe_api_v2.html +COPY libs /app/libs +COPY nginx.conf /etc/nginx/nginx.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..6e14c71 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,16 @@ +variable "TAG" { + default = "latest" +} +variable "REPO" { + default = "registry.mortons.site" +} + +group "default" { + targets = ["five9-softphone"] +} + +target "five9-softphone" { + dockerfile = "Dockerfile" + tags = ["${REPO}/five9-softphone:${TAG}"] + platforms = ["linux/amd64", "linux/arm64"] +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b527cc0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +--- +version: "3.8" + +services: + + five9-softphone: + deploy: + labels: + shepherd.enable: "true" + traefik.enable: "true" + traefik.http.routers.eo-services-client-https.entrypoints: https + traefik.http.routers.eo-services-client-https.rule: Host(`five9-softphone.mortons.site`) + traefik.http.routers.eo-services-client-https.tls: "" + traefik.http.routers.eo-services-client-https.tls.certresolver: le + traefik.http.services.eo-services-client.loadbalancer.server.port: "80" + environment: + TZ: America/Chicago + image: registry.mortons.site/five9-softphone:latest + networks: + traefik_public: null + +networks: + traefik_public: + name: traefik_public + external: true diff --git a/gulpfile.js b/gulpfile.js index 1d32384..928e641 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,7 +17,7 @@ gulp.task('server', function() { } }, ghostMode: false, - host: args.host || 'crm-sdk.five9lab.com', + host: args.host || 'five9-softphone.mortons.site', port: args.port || '443', open: false, startPath: 'iframe_api_v2.html' diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f8097a0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,36 @@ +load_module /usr/lib/nginx/modules/ngx_http_js_module.so; + +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; +events { + worker_connections 1024; +} +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + + location / { + mirror /mirror; + root /app; + index iframe_api_v2.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +} \ No newline at end of file