mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
|
||
---|---|---|
.. | ||
init.d | ||
.gitignore | ||
compose.yml | ||
README.md |
LocalStack
This example shows how to use LocalStack to emulate AWS services locally using docker compose.
Project structure:
.
├── init.d/
│ └── init.sh
├── compose.yaml
└── README.md
services:
localstack:
image: localstack/localstack:2.3.2
ports:
- "4566:4566" # LocalStack Gateway
- "4510-4559:4510-4559" # external services port range
...
Deploy with docker compose
docker compose up -d
It will execute the scripts located in the init.d/
folder to bootstrap 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"
]
}