This commit is contained in:
Vivek Santayana 2021-12-07 13:34:02 +00:00
commit 05740d5aa5
3 changed files with 49 additions and 0 deletions

View File

@ -22,8 +22,11 @@ services:
ref_test_app: ref_test_app:
container_name: ref_test_app container_name: ref_test_app
build: ./ref-test build: ./ref-test
<<<<<<< HEAD
volumes: volumes:
- ./ref-test:/ref-test - ./ref-test:/ref-test
=======
>>>>>>> 9462d7aa7f14b379766503503fd3ba08e1469574
env_file: env_file:
- ./.env - ./.env
ports: ports:
@ -41,7 +44,11 @@ services:
image: mongo:5.0.4-focal image: mongo:5.0.4-focal
restart: unless-stopped restart: unless-stopped
volumes: volumes:
<<<<<<< HEAD
- ./database/data:/data - ./database/data:/data
=======
- ./database/data:/data/db
>>>>>>> 9462d7aa7f14b379766503503fd3ba08e1469574
- ./database/initdb.d/:/docker-entrypoint-initdb.d/ - ./database/initdb.d/:/docker-entrypoint-initdb.d/
env_file: env_file:
- ./.env - ./.env
@ -69,7 +76,11 @@ services:
- ./src/html:/var/www/html - ./src/html:/var/www/html
depends_on: depends_on:
- ref_test_server - ref_test_server
<<<<<<< HEAD
# command: certonly --webroot --webroot-path=/var/www/html --email vsdomainmanager@gmail.com --agree-tos --no-eff-email -d reftest.vsnt.uk # command: certonly --webroot --webroot-path=/var/www/html --email vsdomainmanager@gmail.com --agree-tos --no-eff-email -d reftest.vsnt.uk
=======
# command: certonly --webroot --webroot-path=/var/www/html --email (email) --agree-tos --no-eff-email -d (domain)
>>>>>>> 9462d7aa7f14b379766503503fd3ba08e1469574
networks: networks:
frontend: frontend:

View File

@ -0,0 +1,36 @@
upstream reftest {
server ref_test_app:5000;
}
server {
server_name domain_name;
listen 80;
listen [::]:80;
# Redirect to ssl
return 301 https://$host$request_uri;
}
server {
server_name domain_name;
listen 443 ssl http2;
listen [::]:443 ssl http2;
#SSL configuration
include /etc/nginx/ssl.conf;
include /etc/nginx/certbot-challenge.conf;
location ^~ /static/ {
include /etc/nginx/mime.types;
alias /usr/share/nginx/html/quiz/static/;
}
location ^~ /admin/static/ {
include /etc/nginx/mime.types;
alias /usr/share/nginx/html/admin/static/;
}
location / {
include /etc/nginx/conf.d/common-location.conf;
proxy_pass http://reftest;
}
}

2
nginx/ssl.conf Normal file
View File

@ -0,0 +1,2 @@
ssl_certificate /etc/letsencrypt/live/domain_name/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain_name/privkey.pem; # managed by Certbot