mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-25 02:08:06 +02:00
|
||
---|---|---|
.. | ||
.gitignore | ||
compose.yml | ||
README.md | ||
setup-resources.sh |
LocalStack
This example shows how to use LocalStack to emulate AWS services locally using docker compose.
Project structure:
.
├── compose.yaml
├── README.md
└── setup-resources.sh
services:
localstack:
image: localstack/localstack:2.3.2
ports:
- "4566:4566" # LocalStack Gateway
- "4510-4559:4510-4559" # external services port range
...
setup-resources:
image: mesosphere/aws-cli:1.14.5
volumes:
- ./:/project
...
Deploy with docker compose
docker compose up -d
It will execute the script setup-resources.sh
to setup the resources.
Resources
Once the docker compose is up, it will create the following resources:
Testing the services
From outside the container you can execute the following commands to test the service each service:
- DynamoDB
$ aws --endpoint-url=http://localhost:4566 dynamodb list-tables
{
"TableNames": [
"my_table"
]
}
- Kinesis
$ aws --endpoint-url=http://localhost:4566 kinesis list-streams
{
"StreamNames": [
"my_stream"
]
}
- S3
$ aws --endpoint-url=http://localhost:4566 s3 ls
2022-08-08 03:16:01 example-bucket
- SQS
$ aws --endpoint-url=http://localhost:4566 sqs list-queues
{
"QueueUrls": [
"http://localhost:4566/000000000000/my_queue"
]
}