-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔨 Provide docker-compose.yml for local development
- Loading branch information
Showing
11 changed files
with
93 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
# default (development) environment with localstack | ||
# default (development) environment with local docker-compose.yml | ||
AWS_REGION=eu-central-1 | ||
AWS_ACCESS_KEY_ID=dummy | ||
AWS_SECRET_ACCESS_KEY=dummy | ||
AWS_ACCESS_KEY_ID=dummyAccessKey | ||
AWS_SECRET_ACCESS_KEY=dummyAccessSecret | ||
CAUSALIST_ENCRYPTION_KEY=YeXHqscqShyHU9HRJUm/n2s3DN0ilLbTzhVTb9QeVV0\= | ||
CAUSALIST_PASSWORD_SALT=salt | ||
CAUSALIST_SIGNING_SECRET=secret | ||
CAUSALIST_USERS_TABLE=Users | ||
CAUSALIST_CASES_TABLE=Cases | ||
CAUSALIST_CASE_DOCUMENTS_TABLE=CaseDocuments | ||
# bucket name must contain a dot to force path-style requests to localstack | ||
CAUSALIST_CASE_DOCUMENTS_BUCKET=case.documents | ||
# DynamoDB on localstack | ||
DYNAMODB_URI=http://localhost:4566 | ||
# S3 on localstack | ||
S3_URI=http://localhost:4566 | ||
CAUSALIST_CASE_DOCUMENTS_BUCKET=case-documents | ||
# DynamoDB in local docker | ||
DYNAMODB_URI=http://localhost:8000 | ||
# S3 (MinIO) in local docker | ||
S3_URI=http://localhost:9000 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env bash | ||
# see https://github.com/karl-cardenas-coding/go-lambda-cleanup | ||
# terraform doesn't delete old function versions automatically, see https://github.com/hashicorp/terraform-provider-aws/issues/17668 | ||
# this docker image will do the cleanup, see https://github.com/karl-cardenas-coding/go-lambda-cleanup | ||
docker run -e AWS_ACCESS_KEY_ID="$(aws configure get aws_access_key_id)" -e AWS_SECRET_ACCESS_KEY="$(aws configure get aws_secret_access_key)" ghcr.io/karl-cardenas-coding/go-lambda-cleanup:2.0.12 clean -r "$(aws configure get region)" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.8' | ||
|
||
# run: docker compose up | ||
|
||
services: | ||
|
||
dynamodb: | ||
image: amazon/dynamodb-local:2.2.1 | ||
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data" | ||
ports: | ||
- '8000:8000' | ||
volumes: | ||
- "./docker_data/dynamodb:/home/dynamodblocal/data" | ||
working_dir: /home/dynamodblocal | ||
|
||
minio: | ||
image: quay.io/minio/minio:RELEASE.2024-02-17T01-15-57Z | ||
command: server /data --console-address ":9001" | ||
ports: | ||
- '9000:9000' | ||
- '9001:9001' | ||
volumes: | ||
- './docker_data/minio:/data' | ||
environment: | ||
- MINIO_ROOT_USER=dummyAccessKey | ||
- MINIO_ROOT_PASSWORD=dummyAccessSecret |
15 changes: 6 additions & 9 deletions
15
backend/scripts/init-localstack.sh → scripts/init-local-dynamodb.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initial creation of the required tables in a locally running DynamoDB | ||
|
||
aws dynamodb create-table --table-name Users \ | ||
--attribute-definitions AttributeName=id,AttributeType=S AttributeName=username,AttributeType=S \ | ||
--key-schema AttributeName=id,KeyType=HASH \ | ||
--billing-mode PAY_PER_REQUEST \ | ||
--global-secondary-indexes "[{\"IndexName\":\"UsernameIndex\",\"KeySchema\":[{\"AttributeName\":\"username\",\"KeyType\":\"HASH\"}],\"Projection\":{\"ProjectionType\":\"ALL\"}}]" \ | ||
--output table \ | ||
--endpoint-url http://localhost:4566 | ||
--endpoint-url http://localhost:8000 | ||
|
||
aws dynamodb create-table --table-name Cases \ | ||
--attribute-definitions AttributeName=ownerId,AttributeType=S AttributeName=id,AttributeType=S AttributeName=ref,AttributeType=S AttributeName=settledOn,AttributeType=S \ | ||
--key-schema AttributeName=ownerId,KeyType=HASH AttributeName=id,KeyType=RANGE \ | ||
--billing-mode PAY_PER_REQUEST \ | ||
--local-secondary-indexes "[{\"IndexName\": \"ActiveIndex\", \"KeySchema\": [{\"AttributeName\": \"ownerId\", \"KeyType\": \"HASH\"}, {\"AttributeName\": \"ref\", \"KeyType\": \"RANGE\"}], \"Projection\": {\"ProjectionType\": \"ALL\"}}, {\"IndexName\": \"SettledIndex\", \"KeySchema\": [{\"AttributeName\": \"ownerId\", \"KeyType\": \"HASH\"}, {\"AttributeName\": \"settledOn\", \"KeyType\": \"RANGE\"}], \"Projection\": {\"ProjectionType\": \"ALL\"}}]" \ | ||
--output table \ | ||
--endpoint-url http://localhost:4566 | ||
--endpoint-url http://localhost:8000 | ||
|
||
aws dynamodb create-table --table-name CaseDocuments \ | ||
--attribute-definitions AttributeName=ownerId,AttributeType=S AttributeName=id,AttributeType=S AttributeName=ref,AttributeType=S \ | ||
--key-schema AttributeName=ownerId,KeyType=HASH AttributeName=id,KeyType=RANGE \ | ||
--billing-mode PAY_PER_REQUEST \ | ||
--local-secondary-indexes "[{\"IndexName\": \"ReferenceIndex\", \"KeySchema\": [{\"AttributeName\": \"ownerId\", \"KeyType\": \"HASH\"}, {\"AttributeName\": \"ref\", \"KeyType\": \"RANGE\"}], \"Projection\": {\"ProjectionType\": \"ALL\"}}]" \ | ||
--output table \ | ||
--endpoint-url http://localhost:4566 | ||
|
||
# bucket name must contain a dot to force path-style requests to localstack S3 | ||
aws s3api create-bucket --bucket case.documents \ | ||
--create-bucket-configuration LocationConstraint="$(aws configure get region)" \ | ||
--output table \ | ||
--endpoint-url http://localhost:4566 | ||
--endpoint-url http://localhost:8000 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initial creation of the required bucket in a locally running S3 | ||
|
||
# MinIO requires real access keys, see docker-compose.yml | ||
export AWS_ACCESS_KEY_ID=dummyAccessKey | ||
export AWS_SECRET_ACCESS_KEY=dummyAccessSecret | ||
|
||
aws s3api create-bucket --bucket case-documents \ | ||
--create-bucket-configuration LocationConstraint="$(aws configure get region)" \ | ||
--output table \ | ||
--endpoint-url http://localhost:9000 |