Add a Nginx template using a dynamic hostname from .env
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
version: '3'
|
||||
services:
|
||||
web:
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- "8000:80"
|
||||
- "3000:443"
|
||||
restart: always
|
||||
image: nginx
|
||||
volumes:
|
||||
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
|
||||
- "./etc/ssl:/etc/ssl"
|
||||
- "./web:/var/www/html"
|
||||
- "./etc/nginx/default.template:/etc/nginx/conf.d/default.template"
|
||||
ports:
|
||||
- "8000:80"
|
||||
- "3000:443"
|
||||
environment:
|
||||
- NGINX_HOST=${NGINX_HOST}
|
||||
command: /bin/bash -c "envsubst '$$NGINX_HOST' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||
restart: always
|
||||
depends_on:
|
||||
- php
|
||||
- mysqldb
|
||||
@@ -49,4 +53,4 @@ services:
|
||||
ports:
|
||||
- "8989:3306"
|
||||
volumes:
|
||||
- "./data/db/mysql:/var/lib/mysql"
|
||||
- "./data/db/mysql:/var/lib/mysql"
|
||||
Reference in New Issue
Block a user