diff --git a/Makefile b/Makefile index b27b6e4e..d7a4d6e2 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,8 @@ help: ## Print this help @echo @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' -setup: build up init product index ## Run a full setup, or manually run the following 4 steps +setup: build up init product index ## Run a full local/development setup +setup-prod: up-prod init product index ## Run a full production setup up: ## 1. Bring up your Docker environment docker-compose up -d postgres @@ -70,7 +71,9 @@ push-image: up-prod: ## Bring up production version docker-compose -f docker-compose-prod.yml pull - docker-compose -f docker-compose.yml -f docker-compose-prod.yml up --no-build + docker-compose -f docker-compose.yml -f docker-compose-prod.yml up --detach postgres + docker-compose run checkdb + docker-compose -f docker-compose.yml -f docker-compose-prod.yml up --detach --no-build # This section can be used to deploy onto CloudFormation instead of the 'magic link' create-infra: diff --git a/README.md b/README.md index 59df2e5f..a40d628e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ _First time users of Docker should run:_ * Note that after this step you will either need to logout/login, or run the next step with `sudo` *If you already have `make` , `docker` and `docker-compose` installed* -* `make setup` +* `make setup` or `make setup-prod` (for speed) *If you do not have `make` installed and would rather run the commands individually run the following:* diff --git a/cube-in-a-box-cloudformation.yml b/cube-in-a-box-cloudformation.yml index 25873423..6154e268 100644 --- a/cube-in-a-box-cloudformation.yml +++ b/cube-in-a-box-cloudformation.yml @@ -81,8 +81,8 @@ Resources: wget https://github.com/opendatacube/cube-in-a-box/archive/refs/heads/main.zip -O /home/ubuntu/archive.zip unzip /home/ubuntu/archive.zip -d /home/ubuntu bash /home/ubuntu/cube-in-a-box-main/setup.sh - sed --in-place "s/secretpassword/${SecretPassword}/g" /home/ubuntu/cube-in-a-box-main/Dockerfile - make -C /home/ubuntu/cube-in-a-box-main setup BBOX="${ExtentToIndex}" + echo 'CIABPASSWORD=${SecretPassword}' > /home/ubuntu/cube-in-a-box-main/.env + make -C /home/ubuntu/cube-in-a-box-main setup-prod BBOX="${ExtentToIndex}" Tags: - Key: "Name" Value: !Ref "EC2InstanceName" diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 38d565eb..fff5a615 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -3,3 +3,4 @@ version: '3' services: jupyter: image: opendatacube/cube-in-a-box:latest + command: "jupyter notebook --allow-root --ip='0.0.0.0' -NotebookApp.token='${CIABPASSWORD}'"