Skip to content
Permalink
Browse files

Fitting to ECS

  • Loading branch information...
Laszlo Fogas
Laszlo Fogas committed Oct 20, 2016
1 parent 72eb847 commit 2f2cd6b2069bbc355f63b5945cb979344e338315
Showing with 18 additions and 14 deletions.
  1. +7 −1 docker-compose.yml
  2. +2 −2 env-status.sh
  3. +2 −2 list-envs.sh
  4. +5 −7 start-env.sh
  5. +2 −2 stop-env.sh
@@ -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
@@ -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
@@ -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
@@ -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"
@@ -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
@@ -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.
You can’t perform that action at this time.