diff --git a/docker-compose.production.yml b/docker-compose.production.yml index d2cb1c63..413b2428 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -62,7 +62,7 @@ api_explora: command: uwsgi -s 0.0.0.0:5000 --enable-threads -w explora:app -# TODO: REMOVE thids container, we should use AMAZON Cloudfront + Lincoln NGINX +# TODO: REMOVE this container, we should use AMAZON Cloudfront + Lincoln NGINX nginx: restart: always build: . @@ -75,4 +75,19 @@ nginx: - api_frontend:api_frontend +www_builder: + build: www + links: + - pgsql:pgsql + + volumes: + - ./www/src:/usr/src/app + - ./www/cdn:/usr/src/cdn + + environment: + - POSTGRES_HOST=${POSTGRES_HOST} + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index c0b9b8cd..eb64edb3 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -62,7 +62,7 @@ api_explora: command: uwsgi -s 0.0.0.0:5000 --enable-threads -w explora:app -# TODO: REMOVE thids container, we should use AMAZON Cloudfront + Lincoln NGINX +# TODO: REMOVE this container, we should use AMAZON Cloudfront + Lincoln NGINX nginx: restart: always build: . @@ -75,6 +75,21 @@ nginx: - api_frontend:api_frontend +www_builder: + build: www + links: + - pgsql:pgsql + + volumes: + - ./www/src:/usr/src/app + - ./www/cdn:/usr/src/cdn + + environment: + - POSTGRES_HOST=${POSTGRES_HOST} + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + diff --git a/manager.sh b/manager.sh index c24f4ee7..fa418ce1 100755 --- a/manager.sh +++ b/manager.sh @@ -1,9 +1,10 @@ #!/bin/bash function buildapps(){ - docker-compose -f docker-compose.$1.yml up -d pgsql - sleep 1 - docker run --rm -it --link elcanoiepg_pgsql_1:${POSTGRES_HOST} -v $(pwd)/www:/app -e "POSTGRES_HOST=${POSTGRES_HOST}" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" geographica/elcano_iepg_webbuilder + docker-compose -f docker-compose.$1.yml build www_builder + docker-compose -f docker-compose.$1.yml up www_builder + #sleep 1 + #docker run --rm -it --link elcanoiepg_pgsql_1:${POSTGRES_HOST} -v $(pwd)/www:/app -e "POSTGRES_HOST=${POSTGRES_HOST}" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" geographica/elcano_iepg_webbuilder } @@ -20,7 +21,7 @@ function prerequisites(){ # Fetching submodules git submodule init git submodule update - docker build -t geographica/elcano_iepg_webbuilder www + #docker build -t geographica/elcano_iepg_webbuilder www # Install scripts to upload to amazon s3. If this line fails and you don't want to upload it to Amazon S3/CloudFront just comment it. #gem install s3_website @@ -31,12 +32,14 @@ source config.env; case $1 in start) docker-compose -f docker-compose.$2.yml start + nginx refresh shift ;; restart) docker-compose -f docker-compose.$2.yml stop docker-compose -f docker-compose.$2.yml start + nginx refresh shift # past argument=value ;;