From a0365437c55c8bf460c356c95b0a671ad299180f Mon Sep 17 00:00:00 2001 From: Miguel Ortiz Date: Mon, 23 Sep 2019 20:03:43 -0500 Subject: [PATCH 1/3] Apache2 certificate location settings --- .gitignore | 7 ++++++- apache2/ssl/.gitkeep | 0 docker-compose.yml | 1 + env-example | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 apache2/ssl/.gitkeep diff --git a/.gitignore b/.gitignore index 06732062..42485519 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,9 @@ /nginx/ssl/*.key /nginx/ssl/*.csr -.DS_Store \ No newline at end of file +/apache2/ssl/*.crt +/apache2/ssl/*.key +/apache2/ssl/*.csr +/apache2/ssl/*.org + +.DS_Store diff --git a/apache2/ssl/.gitkeep b/apache2/ssl/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docker-compose.yml b/docker-compose.yml index 07c47f65..b55a9ca3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -313,6 +313,7 @@ services: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 - ${APACHE_SITES_PATH}:/etc/apache2/sites-available + - ${APACHE_SSL_PATH}:/etc/apache2/ssl ports: - "${APACHE_HOST_HTTP_PORT}:80" - "${APACHE_HOST_HTTPS_PORT}:443" diff --git a/env-example b/env-example index 0fd9d9db..1148e307 100644 --- a/env-example +++ b/env-example @@ -233,6 +233,7 @@ APACHE_HOST_HTTP_PORT=80 APACHE_HOST_HTTPS_PORT=443 APACHE_HOST_LOG_PATH=./logs/apache2 APACHE_SITES_PATH=./apache2/sites +APACHE_SSL_PATH=./apache2/ssl APACHE_PHP_UPSTREAM_CONTAINER=php-fpm APACHE_PHP_UPSTREAM_PORT=9000 APACHE_PHP_UPSTREAM_TIMEOUT=60 From da040d7b02ab7e20f051736592e6b71b0b3c6cd6 Mon Sep 17 00:00:00 2001 From: Miguel Ortiz Date: Mon, 23 Sep 2019 20:12:03 -0500 Subject: [PATCH 2/3] Swagger implementation to document Rest APIs --- docker-compose.yml | 18 ++++++++++++++++++ env-example | 9 +++++++++ swagger-editor/Dockerfile | 3 +++ swagger-ui/Dockerfile | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 swagger-editor/Dockerfile create mode 100644 swagger-ui/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index b55a9ca3..dbc010ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1577,3 +1577,21 @@ services: - postgres volumes: - ${DATA_PATH_HOST}/Confluence:/var/atlassian/application-data + +### SWAGGER EDITOR ############################################ + swagger-editor: + build: ./swagger-editor + ports: + - ${SWAGGER_EDITOR_PORT}:8080 + networks: + - backend + +### SWAGGER UI ################################################ + swagger-ui: + build: ./swagger-ui + environment: + - API_URL=${SWAGGER_API_URL} + ports: + - ${SWAGGER_UI_PORT}:8080 + networks: + - backend \ No newline at end of file diff --git a/env-example b/env-example index 1148e307..51dc6878 100644 --- a/env-example +++ b/env-example @@ -725,6 +725,15 @@ PGADMIN_PORT=5050 PGADMIN_DEFAULT_EMAIL=pgadmin4@pgadmin.org PGADMIN_DEFAULT_PASSWORD=admin +### SWAGGER EDITOR ########################################### + +SWAGGER_EDITOR_PORT=5151 + +### SWAGGER UI ############################################### + +SWAGGER_API_URL=http://generator.swagger.io/api/swagger.json +SWAGGER_UI_PORT=5555 + ### SONARQUBE ################################################ ## docker-compose up -d sonarqube ## (If you encounter a database error) diff --git a/swagger-editor/Dockerfile b/swagger-editor/Dockerfile new file mode 100644 index 00000000..f151dfe5 --- /dev/null +++ b/swagger-editor/Dockerfile @@ -0,0 +1,3 @@ +FROM swaggerapi/swagger-editor:latest + +LABEL maintainer="Miguel Ortiz " diff --git a/swagger-ui/Dockerfile b/swagger-ui/Dockerfile new file mode 100644 index 00000000..0f8c6fd1 --- /dev/null +++ b/swagger-ui/Dockerfile @@ -0,0 +1,3 @@ +FROM swaggerapi/swagger-ui:latest + +LABEL maintainer="Miguel Ortiz " From c6a8e5495d9b9c2b8e74eae77ec8e77dd1da57a7 Mon Sep 17 00:00:00 2001 From: Miguel Ortiz Date: Mon, 23 Sep 2019 20:14:32 -0500 Subject: [PATCH 3/3] Add nginx example for nodejs --- nginx/sites/laravel.conf.example | 6 ++++ nginx/sites/node.conf.example | 47 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 nginx/sites/node.conf.example diff --git a/nginx/sites/laravel.conf.example b/nginx/sites/laravel.conf.example index c30bf8ad..c9ba2d96 100644 --- a/nginx/sites/laravel.conf.example +++ b/nginx/sites/laravel.conf.example @@ -1,3 +1,9 @@ +#server { +# listen 80; +# server_name laravel.com.co; +# return 301 https://laravel.com.co$request_uri; +#} + server { listen 80; diff --git a/nginx/sites/node.conf.example b/nginx/sites/node.conf.example new file mode 100644 index 00000000..6fe0c754 --- /dev/null +++ b/nginx/sites/node.conf.example @@ -0,0 +1,47 @@ +#server { +# listen 80; +# server_name node.com.co; +# return 301 https://node.com.co$request_uri; +#} + +server { + + listen 80; + listen [::]:80; + + #listen 443; + #listen [::]:443; + + server_name node.com.co; + + #ssl on; + #ssl_certificate /var/certs/node.com.co/cert.pem; + #ssl_certificate_key /var/certs/node.com.co/privkey.pem; + #ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; + #ssl_ciphers HIGH:!aNULL:!MD5; + + + location / { + proxy_pass http://node.com.co:3001; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_cache_bypass $http_upgrade; + } + + location ~ /\.ht { + deny all; + } + + location /.well-known/acme-challenge/ { + root /var/www/letsencrypt/; + log_not_found off; + } + + error_log /var/log/nginx/node.com.co.local_error.log; + access_log /var/log/nginx/node.com.co.local_access.log; +}