title: docker-compose: how to use minio in- and outside of the docker network
body: <p>I have the following <code>docker-compose.yml</code> to run a local environment for my Laravel App.</p>
  
  <pre><code>version: '3'
  services:
    app:
      build:
        context: .
        dockerfile: .docker/php/Dockerfile
      ports:
        - 80:80
        - 443:443
      volumes:
        - .:/var/www:delegated
      environment:
        AWS_ACCESS_KEY_ID: minio_access_key
        AWS_SECRET_ACCESS_KEY: minio_secret_key
        AWS_BUCKET: Bucket
        AWS_ENDPOINT: http://s3:9000
      links:
        - database
        - s3
    database:
      image: mariadb:10.3
      ports:
        - 63306:3306
      environment:
        MYSQL_ROOT_PASSWORD: secret
    s3:
      image: minio/minio
      ports:
        - "9000:9000"
      volumes:
        - ./storage/minio:/data
      environment:
        MINIO_ACCESS_KEY: minio_access_key
        MINIO_SECRET_KEY: minio_secret_key
      command: server /data
  </code></pre>
  
  <p>As you can see, I use minio as AWS S3 compatible storage. This works very well but when I generate a url for a file (<code>Storage::disk('s3')-&gt;url('some-file.txt')</code>) obviously I get a url like this <code>http://s3:9000/Bucket/some-file.txt</code> which does not work outside of the Docker network.</p>
  
  <p>I've already tried to set <code>AWS_ENDPOINT</code> to <a href="http://127.0.0.1:9000" rel="noreferrer">http://127.0.0.1:9000</a> but then Laravel can't connect to the Minio Server...</p>
  
  <p>Is there a way to configure Docker / Laravel / Minio to generate urls which are accessible in- and outside of the Docker network?</p>