Skip to content

Instantly share code, notes, and snippets.

@borischerkasky
Last active September 23, 2024 22:37
Show Gist options
  • Select an option

  • Save borischerkasky/967970bc52d65cdb432b35c066496bf3 to your computer and use it in GitHub Desktop.

Select an option

Save borischerkasky/967970bc52d65cdb432b35c066496bf3 to your computer and use it in GitHub Desktop.

Revisions

  1. borischerkasky revised this gist Apr 22, 2019. 1 changed file with 15 additions and 10 deletions.
    25 changes: 15 additions & 10 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -4,11 +4,11 @@ services:
    localstack:
    image: localstack/localstack
    ports:
    - "4568-4569:4568-4569"
    - "4568-4576:4568-4576"
    - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
    - DOCKER_HOST=unix:///var/run/docker.sock
    - SERVICES=dynamodb:4569,kinesis:4568
    - SERVICES=dynamodb:4569,kinesis:4568,sqs:4576
    - DEFAULT_REGION=us-east-1
    volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
    @@ -27,13 +27,18 @@ services:
    entrypoint: /bin/sh -c
    command: >
    "
    sleep 5;
    aws dynamodb create-table --no-verify-ssl --endpoint-url https://localstack:4569 --table-name my_metadata \
    --attribute-definitions AttributeName=cookie,AttributeType=S \
    AttributeName=ip,AttributeType=S --key-schema \
    AttributeName=cookie,KeyType=HASH AttributeName=ip,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5;
    aws kinesis create-stream --endpoint-url https://localstack:4568 --stream-name my_stream --shard-count 1;
    # Needed so all localstack components will startup correctly (i'm sure there's a better way to do this)
    sleep 10;
    aws dynamodb create-table --endpoint-url=http://localstack:4569 --table-name my_table \
    --attribute-definitions AttributeName=key,AttributeType=S \
    --key-schema AttributeName=key,KeyType=HASH \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5;
    aws kinesis create-stream --endpoint-url=http://localstack:4568 --stream-name my_stream --shard-count 1;
    aws sqs create-queue --endpoint-url=http://localstack:4576 --queue-name my_queue;
    # you can go on and put initial items in tables...
    "
    networks:
    @@ -42,4 +47,4 @@ services:
    - localstack

    networks:
    my_awesome_network:
    my_awesome_network:
  2. borischerkasky revised this gist Mar 28, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ services:
    AttributeName=cookie,KeyType=HASH AttributeName=ip,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5;
    aws kinesis create-stream --endpoint-url https://localstack:4568 --stream-name my_stream --shard-count 1;
    # you can go aon ant put initial items in tables...
    # you can go on and put initial items in tables...
    "
    networks:
    - my_awesome_network
  3. borischerkasky revised this gist Mar 25, 2019. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,6 @@ services:
    - DOCKER_HOST=unix:///var/run/docker.sock
    - SERVICES=dynamodb:4569,kinesis:4568
    - DEFAULT_REGION=us-east-1
    - USE_SSL=true
    volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
    - "/private${TMPDIR}:/tmp/localstack"
    @@ -35,7 +34,6 @@ services:
    AttributeName=cookie,KeyType=HASH AttributeName=ip,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5;
    aws kinesis create-stream --endpoint-url https://localstack:4568 --stream-name my_stream --shard-count 1;
    # you can go aon ant put initial items in tables...
    "
    networks:
  4. borischerkasky renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. borischerkasky revised this gist Mar 25, 2019. 1 changed file with 31 additions and 1 deletion.
    32 changes: 31 additions & 1 deletion gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,38 @@ services:
    - DOCKER_HOST=unix:///var/run/docker.sock
    - SERVICES=dynamodb:4569,kinesis:4568
    - DEFAULT_REGION=us-east-1
    - USE_SSL=true
    volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
    - "/private${TMPDIR}:/tmp/localstack"
    networks:
    - my_awesome_network
    - my_awesome_network

    setup-resources:
    image: mesosphere/aws-cli
    volumes:
    - ./dev_env:/project/dev_env
    environment:
    - AWS_ACCESS_KEY_ID=dummyaccess
    - AWS_SECRET_ACCESS_KEY=dummysecret
    - AWS_DEFAULT_REGION=us-east-1
    entrypoint: /bin/sh -c
    command: >
    "
    sleep 5;
    aws dynamodb create-table --no-verify-ssl --endpoint-url https://localstack:4569 --table-name my_metadata \
    --attribute-definitions AttributeName=cookie,AttributeType=S \
    AttributeName=ip,AttributeType=S --key-schema \
    AttributeName=cookie,KeyType=HASH AttributeName=ip,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5;
    aws kinesis create-stream --endpoint-url https://localstack:4568 --stream-name my_stream --shard-count 1;
    # you can go aon ant put initial items in tables...
    "
    networks:
    - my_awesome_network
    depends_on:
    - localstack

    networks:
    my_awesome_network:
  6. borischerkasky renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. borischerkasky created this gist Mar 25, 2019.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    version: "3"

    services:
    localstack:
    image: localstack/localstack
    ports:
    - "4568-4569:4568-4569"
    - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
    - DOCKER_HOST=unix:///var/run/docker.sock
    - SERVICES=dynamodb:4569,kinesis:4568
    - DEFAULT_REGION=us-east-1
    volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
    - "/private${TMPDIR}:/tmp/localstack"
    networks:
    - my_awesome_network