Commit 8e92ea58 authored by Jacob Priddy's avatar Jacob Priddy 👌

get website going with ssl

parent 90dcbf3e
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
"${DIR}/../secrets/gen-certs.sh"
docker-compose -f "${DIR}/../docker-compose.yml" up -d
docker-compose -f "${DIR}/../docker-compose.yml" exec api ./install-dev.sh
version: '3'
version: '3.7'
networks:
doorcode:
driver: bridge
secrets:
webserver_cert:
file: ./secrets/certs/webserver.cert
webserver_key:
file: ./secrets/certs/webserver.key
volumes:
db-data:
services:
webserver:
image: nginx:1-alpine
container_name: webserver
restart: unless-stopped
tty: true
secrets:
- webserver_cert
- webserver_key
ports:
- "8080:80"
- "8080:443"
volumes:
- ./src/web:/var/www
- ./nginx/conf.d/:/etc/nginx/conf.d/
......@@ -33,6 +45,8 @@ services:
tty: true
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: web
POSTGRES_PASSWORD: secret
......@@ -46,6 +60,8 @@ services:
tty: true
ports:
- "8081:80"
depends_on:
- postgres
environment:
PHP_PG_ADMIN_SERVER_HOST: postgres
PHP_PG_ADMIN_SERVER_DEFAULT_DB: doorcode
......
......@@ -5,9 +5,13 @@ upstream localhost.api {
}
server {
listen 80;
listen 443 ssl;
index index.php index.html;
server_name localhost;
ssl_certificate /run/secrets/webserver_cert;
ssl_certificate_key /run/secrets/webserver_key;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/frontend;
......@@ -48,9 +52,13 @@ server {
server {
listen 80;
listen 443 ssl;
index index.php index.html;
server_name localhost.api;
ssl_certificate /run/secrets/webserver_cert;
ssl_certificate_key /run/secrets/webserver_key;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/backend/public;
......
*
!.gitignore
\ No newline at end of file
#!/bin/bash
echo "Generating cert for domain: $1"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
-subj "/C=US/ST=Washington/L=College Place/O=WWU/CN=$1" \
-keyout "${DIR}/certs/webserver.key" -out "${DIR}/certs/webserver.cert"
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Install php dependencies
composer install -d backend
composer install -d "${DIR}/backend"
# configure the backend
cd backend || exit
./configure.sh
"${DIR}/backend/configure.sh"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment