Working production version of nginx

- Staging missing
- MySQL auth workaround
This commit is contained in:
Ari Timonen 2020-10-10 21:39:45 +02:00
parent 85468b68d6
commit 977d64e579
2 changed files with 4 additions and 5 deletions

View file

@ -11,14 +11,13 @@ SCRYPT_MAX_TIME=0.001
PUMA_WORKERS=0 PUMA_WORKERS=0
PUMA_MIN_THREADS=1 PUMA_MIN_THREADS=1
PUMA_MAX_THREADS=32 PUMA_MAX_THREADS=32
PRODUCTION_PUMA_PORT=4000
PUMA_TIMEOUT=30 PUMA_TIMEOUT=30
PRODUCTION_PUMA_PORT=4000
PRODUCTION_ROOT_DOMAIN=ensl.org PRODUCTION_ROOT_DOMAIN=ensl.org
PRODUCTION_DOMAIN=www.ensl.org PRODUCTION_DOMAIN=www.ensl.org
PRODUCTION_PORT=80 PRODUCTION_PORT=80
PRODUCTION_PORT_SSL=443 PRODUCTION_PORT_SSL=443
PRODUCTION_NGINX_PUBLIC=/var/www
MYSQL_DATABASE=ensl MYSQL_DATABASE=ensl
MYSQL_CONNECTION_POOL=48 MYSQL_CONNECTION_POOL=48

View file

@ -127,7 +127,7 @@ services:
image: mariadb:latest image: mariadb:latest
container_name: ensl_db container_name: ensl_db
user: "mysql:mysql" user: "mysql:mysql"
# debug; command: mysqld_safe --skip-grant-tables command: mysqld_safe --skip-grant-tables
volumes: volumes:
- "./db/data:/var/lib/mysql" - "./db/data:/var/lib/mysql"
- "./db/initdb.d:/docker-entrypoint-initdb.d" - "./db/initdb.d:/docker-entrypoint-initdb.d"
@ -154,7 +154,7 @@ services:
container_name: ensl_nginx container_name: ensl_nginx
tty: true tty: true
stdin_open: true stdin_open: true
command: /bin/bash -c "cat /etc/nginx/conf.d/ensl_production/*.conf.template|envsubst '$$PRODUCTION_PUMA_PORT $$PRODUCTION_ROOT_DOMAIN $$PRODUCTION_DOMAIN $$PRODUCTION_PORT $$PRODUCTION_PORT_SSL $$PRODUCTION_NGINX_PUBLIC $$PUMA_PORT $$APP_PATH $$APP_PATH_PUBLIC $$STAGING_ROOT_DOMAIN $$STAGING_DOMAIN $$STAGING_PORT $$STAGING_PORT_SSL' > /etc/nginx/conf.d/default.conf && cat /etc/nginx/conf.d/*.conf && nginx -g 'daemon off;'" command: /bin/bash -c "cat /etc/nginx/conf.d/ensl_production/prod*.conf.template|envsubst '$$PRODUCTION_PUMA_PORT $$PRODUCTION_ROOT_DOMAIN $$PRODUCTION_DOMAIN $$PRODUCTION_PORT $$PRODUCTION_PORT_SSL $$PRODUCTION_NGINX_PUBLIC $$PUMA_PORT $$APP_PATH $$APP_PATH_PUBLIC $$STAGING_ROOT_DOMAIN $$STAGING_DOMAIN $$STAGING_PORT $$STAGING_PORT_SSL' > /etc/nginx/conf.d/default.conf && cat /etc/nginx/conf.d/*.conf && nginx -g 'daemon off;'"
# TODO: use env vars here # TODO: use env vars here
volumes: volumes:
- ext/ssl:/etc/ssl - ext/ssl:/etc/ssl
@ -173,7 +173,7 @@ services:
- PRODUCTION_DOMAIN=$PRODUCTION_DOMAIN - PRODUCTION_DOMAIN=$PRODUCTION_DOMAIN
- PRODUCTION_PORT=$PRODUCTION_PORT - PRODUCTION_PORT=$PRODUCTION_PORT
- PRODUCTION_PORT_SSL=$PRODUCTION_PORT_SSL - PRODUCTION_PORT_SSL=$PRODUCTION_PORT_SSL
- PRODUCTION_NGINX_PUBLIC=$PRODUCTION_NGINX_PUBLIC - PRODUCTION_NGINX_PUBLIC=/srv/production
- STAGING_PUMA_PORT=$STAGING_PUMA_PORT - STAGING_PUMA_PORT=$STAGING_PUMA_PORT
- STAGING_ROOT_DOMAIN=$STAGING_ROOT_DOMAIN - STAGING_ROOT_DOMAIN=$STAGING_ROOT_DOMAIN
- STAGING_DOMAIN=$STAGING_DOMAIN - STAGING_DOMAIN=$STAGING_DOMAIN