title: Running shell script against Localstack in docker container
body: <p>I've been using localstack to develop a service against locally. I've just been running their docker image via <code>docker run --rm -p 4567-4583:4567-4583 -p 8080:8080 localstack/localstack</code></p>
  
  <p>And then I manually run a small script to set up my S3 buckets, SQS queues, etc.</p>
  
  <p>Now, I'd like to make this easier for others so I thought I'd just add a Dockerfile and docker-compose.yml file. Unfortunately, when I try to get this up and running, using <code>docker-compose up</code> I get an error that the command from my setup script can't connect to the localstack services. </p>
  
  <pre><code>make_bucket failed: s3://localbucket Could not connect to the endpoint URL: "http://localhost:4572/localbucket"
  </code></pre>
  
  <p>Dockerfile:</p>
  
  <pre><code>FROM localstack/localstack
  
  #since this is just local dev set up, localstack doesn't require 
  anything specific here.
  ENV AWS_DEFAULT_REGION='[useast1]'
  ENV AWS_ACCESS_KEY_ID='[lloyd]'
  ENV AWS_SECRET_ACCESS_KEY='[christmas]'
  
  COPY bin/localSetup.sh /localSetup.sh
  COPY fixtures/notifications.json /notifications.json
  RUN ["chmod", "+x", "/localSetup.sh"]
  RUN pip install awscli
  
  # expose service &amp; web dashboard ports
  EXPOSE 4567-4582 8080
  
  ENTRYPOINT ["/localSetup.sh"]
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  services:
    localstack:
      build: .
      ports:
        - "8080:8080"
        - "4567-4582:4567-4582"
  </code></pre>
  
  <p>localSetup.sh</p>
  
  <pre><code>#!/bin/bash
  
  aws --endpoint-url=http://localhost:4572 s3 mb s3://localbucket
  #additional similar calls but left off for brevity
  </code></pre>
  
  <p>I've tried switching <code>localhost</code> to <code>127.0.0.1</code> in my script commands, but I wind up with the same error. I'm probably missing something silly here.</p>