-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(s3): add first draft for s3 flavor
This is just adding the setup on the backend. It will still need a custom bootstrapping script to create some useful preconfigured collections.
- Loading branch information
1 parent
8b8e06c
commit 51f017c
Showing
3 changed files
with
74 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This file is meant to be merged with a base file! | ||
services: | ||
dataverse: | ||
environment: | ||
JVM_ARGS: | ||
-Ddataverse.files.localstack.type=s3 | ||
-Ddataverse.files.localstack.label=LocalStack | ||
-Ddataverse.files.localstack.custom-endpoint-url=http://localstack:4566 | ||
-Ddataverse.files.localstack.custom-endpoint-region=us-east-2 | ||
-Ddataverse.files.localstack.bucket-name=localstack | ||
-Ddataverse.files.localstack.path-style-access=true | ||
-Ddataverse.files.localstack.upload-redirect=true | ||
-Ddataverse.files.localstack.download-redirect=true | ||
-Ddataverse.files.localstack.access-key=default | ||
-Ddataverse.files.localstack.secret-key=default | ||
-Ddataverse.files.minio.type=s3 | ||
-Ddataverse.files.minio.label=MinIO | ||
-Ddataverse.files.minio.custom-endpoint-url=http://minio:9000 | ||
-Ddataverse.files.minio.custom-endpoint-region=us-east-1 | ||
-Ddataverse.files.minio.bucket-name=minio | ||
-Ddataverse.files.minio.path-style-access=true | ||
-Ddataverse.files.minio.upload-redirect=false | ||
-Ddataverse.files.minio.download-redirect=false | ||
-Ddataverse.files.minio.access-key=supersecret | ||
-Ddataverse.files.minio.secret-key=supersecret | ||
|
||
localstack: | ||
container_name: "localstack" | ||
image: localstack/localstack:latest | ||
restart: on-failure | ||
ports: | ||
- "4566:4566" | ||
environment: | ||
- DEBUG=${DEBUG-} | ||
- DOCKER_HOST=unix:///var/run/docker.sock | ||
- LOCALSTACK_HOST=localstack | ||
networks: | ||
- dataverse | ||
volumes: | ||
- "${RUNNER_TEMP}/localstack:/var/lib/localstack" | ||
- "${GITHUB_ACTION_PATH}/s3/localstack:/etc/localstack/init/ready.d" | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
|
||
minio: | ||
container_name: "minio" | ||
image: minio/minio | ||
restart: on-failure | ||
ports: | ||
- "9000:9000" | ||
- "9001:9001" | ||
networks: | ||
- dataverse | ||
volumes: | ||
- "${RUNNER_TEMP}/minio:/data" | ||
environment: | ||
MINIO_ROOT_USER: supersecret | ||
MINIO_ROOT_PASSWORD: supersecret | ||
entrypoint: sh | ||
command: -c 'mkdir -p /data/minio && /usr/bin/minio server /data' | ||
|
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,10 @@ | ||
{ | ||
"CORSRules": [ | ||
{ | ||
"AllowedOrigins": ["*"], | ||
"AllowedHeaders": ["*"], | ||
"AllowedMethods": ["PUT", "GET"], | ||
"ExposeHeaders": ["ETag", "Accept-Ranges", "Content-Encoding", "Content-Range"] | ||
} | ||
] | ||
} |
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,4 @@ | ||
#!/usr/bin/env bash | ||
# https://stackoverflow.com/questions/53619901/auto-create-s3-buckets-on-localstack | ||
awslocal s3 mb s3://localstack | ||
awslocal s3api put-bucket-cors --bucket localstack --cors-configuration file:///etc/localstack/init/ready.d/cors.json |