Handle https with nginx, add sample configuration file

This commit is contained in:
Filip Gralinski 2020-03-17 16:52:36 +01:00
parent c58d9b8d11
commit dba5152edd
4 changed files with 57 additions and 2 deletions

1
.gitignore vendored
View File

@ -22,3 +22,4 @@ arena/t*
arena/r*
gonito-*.tar.gz
stack.yaml.lock
.env

View File

@ -1,5 +1,15 @@
version: '3'
services:
nginx:
image: nginx:latest
container_name: production_nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ${NGINX_CERTIFICATE_DIR}:/etc/certs
ports:
- 443:443
depends_on:
- gonito
gonito:
image: loxygen/gonito
depends_on:
@ -11,8 +21,13 @@ services:
- ADMINUSER=$GONITO_ADMINUSER
- ADMINPASS=$GONITO_ADMINPASS
- LOCATION=$GONITO_LOCATION
ports:
- "3000:3000"
- APPROOT=$GONITO_APPROOT
- LEADERBOARD_STYLE=${GONITO_LEADERBOARD_STYLE:-by-tag}
- AUTO_OPENING=${GONITO_AUTO_OPENING:-false}
expose:
- "3000"
volumes:
- "${GONITO_ARENA_VOLUME}:/gonito/arena"
postgres:
image: postgres
environment:

29
nginx.conf Normal file
View File

@ -0,0 +1,29 @@
events {
}
error_log /dev/stderr info;
error_log /dev/stderr warn;
error_log /dev/stderr error;
http {
client_max_body_size 20m;
upstream gonito {
server gonito:3000;
}
server {
server_name zacna-ania;
location / {
proxy_pass http://gonito;
proxy_redirect off;
}
listen 443 ssl;
ssl_certificate /etc/certs/fullchain.pem;
ssl_certificate_key /etc/certs/privkey.pem;
}
}

10
sample.env Normal file
View File

@ -0,0 +1,10 @@
PG_DATA_VOLUME=/home/user/pg-data
POSTGRES_PASSWORD=aC3xo2te
GONITO_ADMINUSER=admin
GONITO_ADMINPASS=Ahxuz5du
GONITO_LOCATION=test
GONITO_ARENA_VOLUME=/home/user/arena
GONITO_APPROOT=https://localhost:443
GONITO_LEADERBOARD_STYLE=by-tag
GONITO_AUTO_OPENING=false
NGINX_CERTIFICATE_DIR=/home/user/certs