-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FPO-194: Add docker-compose + LocalStack (www.localstack.cloud) #19
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: "2" | ||
services: | ||
redis: | ||
container_name: redis | ||
image: redis | ||
ports: | ||
- 127.0.0.1:6379:6379 | ||
volumes: | ||
- dev-env-redis-volume:/data | ||
hmrc-postgres: | ||
container_name: postgres | ||
image: postgres:13 | ||
environment: | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
- POSTGRES_USER=${USER} | ||
- POSTGRES_PASSWORD= | ||
- LANG=C.UTF-8 | ||
- POSTGRES_HOST_AUTH_METHOD=trust | ||
ports: | ||
- 127.0.0.1:5432:5432 | ||
volumes: | ||
- hmrc-postgres13:/var/lib/postgresql/data | ||
hmrc-opensearch: | ||
container_name: hmrc-opensearch | ||
image: opensearchproject/opensearch:2 | ||
ports: | ||
- 127.0.0.1:9200:9200 | ||
- 127.0.0.1:9300:9300 | ||
environment: | ||
- bootstrap.memory_lock=true | ||
- discovery.type=single-node | ||
- "OPENSEARCH_JAVA_OPTS=-Xms500m -Xmx500m" | ||
- cluster.routing.allocation.disk.threshold_enabled=false | ||
- plugins.security.disabled=true | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
healthcheck: | ||
interval: 60s | ||
retries: 10 | ||
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"' | ||
volumes: | ||
- hmrc-os:/usr/share/opensearch/data | ||
- ./config/opensearch/synonyms_all.txt:/usr/share/opensearch/config/synonyms_all.txt:z | ||
- ./config/opensearch/stemming_exclusions_all.txt:/usr/share/opensearch/config/stemming_exclusions_all.txt:z | ||
|
||
localstack: | ||
image: localstack/localstack:latest | ||
ports: | ||
- 4566:4566 # LocalStack edge port | ||
- 4510-4559:4510-4559 # maps various AWS services ports | ||
volumes: | ||
# Initialization Hook (see https://docs.localstack.cloud/references/init-hooks/) | ||
- ./localstack-setup.sh:/etc/localstack/init/ready.d/script.sh | ||
volumes: | ||
dev-env-redis-volume: | ||
driver: local | ||
postgres: | ||
driver: local | ||
hmrc-postgres: | ||
driver: local | ||
hmrc-postgres13: | ||
driver: local | ||
hmrc-os: | ||
driver: local |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
echo "Initializing localstack s3" | ||
|
||
# You must specify a region. You can also configure your region by running "aws configure". | ||
|
||
echo "Creating dynamodb tables..." | ||
aws --endpoint-url=http://localhost:4566 dynamodb create-table \ | ||
--region eu-west-2 \ | ||
--table-name CustomerApiKeys \ | ||
--attribute-definitions \ | ||
AttributeName=CustomerApiKeyId,AttributeType=S \ | ||
AttributeName=FpoId,AttributeType=S \ | ||
--key-schema \ | ||
AttributeName=CustomerApiKeyId,KeyType=HASH \ | ||
AttributeName=FpoId,KeyType=RANGE \ | ||
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 | ||
|
||
echo "Creating API Gateway..." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you thinking you want to do this part in a separate PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. basically I don't know how to do that 😅 |
||
# TODO: Create API Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think we can just embed these two configuration files as part of https://github.com/trade-tariff/trade-tariff-tech-docs/blob/main/source/manual/get-started.html.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way, when we have a new dev starting they can copy this file into
~