Localstack starts in Docker, but I can't access

Viewed 4098

I run a docker compose to start an instance of localstack with the S3 service. It starts normally, but when trying to use the AWS CLI to access it I get the following error:

>  aws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket demo-bucket --acl public-read

Connection was closed before we received a valid response from endpoint URL: "http://localhost:4572/demo-bucket?acl".

The docker compose:

version: '3.7'
services:
  localstack:
    image: localstack/localstack
    container_name: localstack_service
    ports:
      - "4567-4584:4567-4584"
      - "8055:8080"
    environment:
      - SERVICES=s3
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
    volumes:
      - ./tmp/localstack:/tmp/localstack   
      - /var/run/docker.sock:/var/run/docker.sock
networks:
  default:
    name: mock_demo

I think the problem is on localstack, because I can't even access the web page.

1 Answers

I used the version

localstack_demo | LocalStack version: 0.12.1

According to the project documentation on GitHub, in this version all APIs are exposed via a single edge service, which is accessible on http://localhost:4566 by default.

Related