From cb84e929ddfeac9e4bbd98c112093f54f3345d2c Mon Sep 17 00:00:00 2001 From: Herval Freire Date: Wed, 19 Jun 2019 12:20:35 -0700 Subject: [PATCH] yasss --- Dockerfile | 2 +- conf/.env.docker | 2 ++ conf/{nginx-site.conf => nginx-site.conf.template} | 4 ++-- docker-compose.yml | 1 + entrypoint.sh | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) rename conf/{nginx-site.conf => nginx-site.conf.template} (88%) diff --git a/Dockerfile b/Dockerfile index 1565d086..b294af73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,7 +90,7 @@ RUN wget ${archive_url} && \ COPY conf/php-fpm-pool.conf /etc/php7/php-fpm.d/www.conf COPY conf/supervisord.conf /etc/supervisor/supervisord.conf COPY conf/nginx.conf /etc/nginx/nginx.conf -COPY conf/nginx-site.conf /etc/nginx/conf.d/default.conf +COPY conf/nginx-site.conf.template /etc/nginx/conf.d/default.conf.template COPY conf/.env.docker /var/www/html/.env COPY entrypoint.sh /sbin/entrypoint.sh diff --git a/conf/.env.docker b/conf/.env.docker index c3d7a751..32171d23 100644 --- a/conf/.env.docker +++ b/conf/.env.docker @@ -12,6 +12,8 @@ DB_PASSWORD="{{DB_PASSWORD}}" DB_PORT="{{DB_PORT}}" DB_PREFIX="{{DB_PREFIX}}" +PORT="{{PORT}}" + DOCKER=true CACHE_DRIVER="{{CACHE_DRIVER}}" diff --git a/conf/nginx-site.conf b/conf/nginx-site.conf.template similarity index 88% rename from conf/nginx-site.conf rename to conf/nginx-site.conf.template index 08971839..ca070b77 100644 --- a/conf/nginx-site.conf +++ b/conf/nginx-site.conf.template @@ -1,6 +1,6 @@ server { - listen 8000 default; ## Listen for ipv4; this line is default and implied - listen [::]:8000 default; ## Listen for ipv6 + listen $PORT default; ## Listen for ipv4; this line is default and implied + listen [::]:$PORT default; ## Listen for ipv6 # Make site accessible from http://localhost/ server_name localhost; diff --git a/docker-compose.yml b/docker-compose.yml index 2703373a..2eee6163 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,7 @@ services: - APP_KEY=${APP_KEY:-null} - APP_LOG=errorlog - DEBUG=false + - PORT=8000 depends_on: - postgres restart: on-failure diff --git a/entrypoint.sh b/entrypoint.sh index 5fd333f1..e51ecc24 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -75,6 +75,7 @@ initialize_system() { APP_DEBUG=${APP_DEBUG:-true} APP_URL=${APP_URL:-http://localhost} APP_LOG=${APP_LOG:-errorlog} + PORT=${PORT:-8000} DB_DRIVER=${DB_DRIVER:-pgsql} DB_HOST=${DB_HOST:-postgres} @@ -228,6 +229,7 @@ start_system() { seed_db echo "Starting Cachet! ..." php artisan config:cache + envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf }