Last active
September 23, 2024 22:37
-
-
Save borischerkasky/967970bc52d65cdb432b35c066496bf3 to your computer and use it in GitHub Desktop.
localstack docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| localstack: | |
| image: localstack/localstack | |
| ports: | |
| - "4568-4569:4568-4569" | |
| - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}" | |
| environment: | |
| - DOCKER_HOST=unix:///var/run/docker.sock | |
| - SERVICES=dynamodb:4569,kinesis:4568 | |
| - DEFAULT_REGION=us-east-1 | |
| volumes: | |
| - "/var/run/docker.sock:/var/run/docker.sock" | |
| - "/private${TMPDIR}:/tmp/localstack" | |
| networks: | |
| - my_awesome_network | |
| setup-resources: | |
| image: mesosphere/aws-cli | |
| volumes: | |
| - ./dev_env:/project/dev_env | |
| environment: | |
| - AWS_ACCESS_KEY_ID=dummyaccess | |
| - AWS_SECRET_ACCESS_KEY=dummysecret | |
| - AWS_DEFAULT_REGION=us-east-1 | |
| entrypoint: /bin/sh -c | |
| command: > | |
| " | |
| sleep 5; | |
| aws dynamodb create-table --no-verify-ssl --endpoint-url https://localstack:4569 --table-name my_metadata \ | |
| --attribute-definitions AttributeName=cookie,AttributeType=S \ | |
| AttributeName=ip,AttributeType=S --key-schema \ | |
| AttributeName=cookie,KeyType=HASH AttributeName=ip,KeyType=RANGE \ | |
| --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5; | |
| aws kinesis create-stream --endpoint-url https://localstack:4568 --stream-name my_stream --shard-count 1; | |
| # you can go aon ant put initial items in tables... | |
| " | |
| networks: | |
| - my_awesome_network | |
| depends_on: | |
| - localstack | |
| networks: | |
| my_awesome_network: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment