From 4e320045f2d1c8e013276315a91cb075544a8e18 Mon Sep 17 00:00:00 2001 From: Evert Ramos Date: Wed, 24 Jan 2018 10:56:21 -0200 Subject: [PATCH] default values for variables --- .gitignore | 4 +++- docker-compose-multiple-networks.yml | 34 ++++++++++++++-------------- docker-compose.yml | 32 +++++++++++++------------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 2eea525..221e994 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.env \ No newline at end of file +data +.env* +!.env.sample diff --git a/docker-compose-multiple-networks.yml b/docker-compose-multiple-networks.yml index 68f84de..8cafdf3 100644 --- a/docker-compose-multiple-networks.yml +++ b/docker-compose-multiple-networks.yml @@ -7,14 +7,14 @@ services: container_name: ${NGINX_WEB:-nginx-web} restart: always ports: - - "${IP}:80:80" - - "${IP}:443:443" + - "${IP:-0.0.0.0}:80:80" + - "${IP:-0.0.0.0}:443:443" volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:ro - - ${NGINX_FILES_PATH:-data}/htpasswd:/etc/nginx/htpasswd:ro + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro + - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro networks: - default - outside @@ -29,11 +29,11 @@ services: container_name: ${DOCKER_GEN:-nginx-gen} restart: always volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:ro - - ${NGINX_FILES_PATH:-data}/htpasswd:/etc/nginx/htpasswd:ro + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro + - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro - /var/run/docker.sock:/tmp/docker.sock:ro - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro networks: @@ -49,10 +49,10 @@ services: container_name: ${LETS_ENCRYPT:-nginx-letsencrpt} restart: always volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:rw + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:rw - /var/run/docker.sock:/var/run/docker.sock:ro environment: NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN:-nginx-gen} @@ -71,4 +71,4 @@ networks: name: ${NETWORK:-webproxy} outside: external: - name: ${SERVICE_NETWORK} + name: ${SERVICE_NETWORK:-webservices} diff --git a/docker-compose.yml b/docker-compose.yml index 4df1923..795f67c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,14 +7,14 @@ services: container_name: ${NGINX_WEB:-nginx-web} restart: always ports: - - "${IP}:80:80" - - "${IP}:443:443" + - "${IP:-0.0.0.0}:80:80" + - "${IP:-0.0.0.0}:443:443" volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:ro - - ${NGINX_FILES_PATH:-data}/htpasswd:/etc/nginx/htpasswd:ro + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro + - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro logging: options: max-size: ${NGINX_WEB_LOG_MAX_SIZE:-4m} @@ -26,11 +26,11 @@ services: container_name: ${DOCKER_GEN:-nginx-gen} restart: always volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:ro - - ${NGINX_FILES_PATH:-data}/htpasswd:/etc/nginx/htpasswd:ro + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro + - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro - /var/run/docker.sock:/tmp/docker.sock:ro - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro logging: @@ -43,10 +43,10 @@ services: container_name: ${LETS_ENCRYPT:-nginx-letsencrypt} restart: always volumes: - - ${NGINX_FILES_PATH:-data}/conf.d:/etc/nginx/conf.d - - ${NGINX_FILES_PATH:-data}/vhost.d:/etc/nginx/vhost.d - - ${NGINX_FILES_PATH:-data}/html:/usr/share/nginx/html - - ${NGINX_FILES_PATH:-data}/certs:/etc/nginx/certs:rw + - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d + - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d + - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html + - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:rw - /var/run/docker.sock:/var/run/docker.sock:ro environment: NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN:-nginx-gen}