Skip to content

Commit

Permalink
Fitting to ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
Laszlo Fogas committed Oct 20, 2016
1 parent 72eb847 commit 2f2cd6b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ services:
image: laszlocph/composetest
ports:
- "${PORT}:5000"
depends_on:
links:
- redis
cpu_shares: 100
mem_limit: 131200000
boot:
image: laszlocph/spring-boot-dummy #https://api.github.com/repos/laszlocph/spring-boot-dummy/branches
cpu_shares: 300
mem_limit: 262400000
redis:
image: redis
cpu_shares: 100
mem_limit: 131200000
4 changes: 2 additions & 2 deletions env-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ fi

ENV=$1

eval "$(docker-machine env composeHost)"
docker-compose -p $ENV ps
ecs-cli configure --region eu-west-1 --cluster cluster01
ecs-cli compose --project-name $ENV --file docker-compose.$ENV.yml service ps
4 changes: 2 additions & 2 deletions list-envs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

eval "$(docker-machine env composeHost)"
docker ps
ecs-cli configure --region eu-west-1 --cluster cluster01
ecs-cli ps
12 changes: 5 additions & 7 deletions start-env.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash

eval "$(docker-machine env -u)"

MACHINE_IP="$(docker-machine ip composeHost)"
ecs-cli configure --region eu-west-1 --cluster cluster01
ENV="$(pwgen -A -s -1 4 | tr '[:upper:]' '[:lower:]')"

echo "Generating environment with id $ENV"
Expand All @@ -12,13 +10,13 @@ docker run --rm -it -u $(id -u):$(id -u) -v $(pwd):/composer/project laszlocph/c
#https://docs.docker.com/compose/environment-variables/
export PORT=$(python get-port.py)

eval "$(docker-machine env composeHost)"
#inspired by https://docs.docker.com/compose/extends/
docker-compose -p $ENV -f docker-compose.$ENV.yml up -d
ecs-cli compose --project-name $ENV --file docker-compose.$ENV.yml service up

MACHINE_IP="TODO"

echo
echo "Environment $ENV is exposed on http://$MACHINE_IP:$PORT"
echo
docker-compose -p $ENV ps
ecs-cli compose --project-name $ENV --file docker-compose.$ENV.yml service ps
echo
docker ps
4 changes: 2 additions & 2 deletions stop-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ fi

ENV=$1

eval "$(docker-machine env composeHost)"
docker-compose -p $ENV stop
ecs-cli configure --region eu-west-1 --cluster cluster01
ecs-cli compose --project-name $ENV --file docker-compose.$ENV.yml service stop

0 comments on commit 2f2cd6b

Please sign in to comment.