-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emulate Azure blob storage and AWS S3 (#2461)
* Add scripts to run azure or s3 locally * Update local-dev script to choose storage based on SOURCE from .env * [pre-commit.ci] auto fixes from pre-commit hooks * Replace localstack with localstack-persist * Update .env comments --------- Co-authored-by: angelathe <angela.the@skylight.digital> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4af8605
commit 3df0e4f
Showing
9 changed files
with
72 additions
and
7 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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
DATABASE_URL=postgres://postgres:pw@localhost:5432/ecr_viewer_db | ||
AWS_CUSTOM_ENDPOINT="http://localhost:4566" | ||
AWS_REGION=us-east-1 | ||
ECR_BUCKET_NAME=ecr-viewer-files | ||
AZURE_STORAGE_CONNECTION_STRING=idk | ||
AZURE_CONTAINER_NAME=idk | ||
# These are the default credentials for localstack | ||
AWS_ACCESS_KEY_ID=123 | ||
AWS_SECRET_ACCESS_KEY=xyz | ||
# NOT A REAL CONNECTION STRING! This is the default connection string for Azurite | ||
# https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio%2Cblob-storage#well-known-storage-account-and-key | ||
AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://0.0.0.0:10000/devstoreaccount1;" | ||
AZURE_CONTAINER_NAME=ecr-viewer-files | ||
SOURCE=postgres | ||
NEXT_TELEMETRY_DISABLED=1 | ||
NEXT_PUBLIC_NON_INTEGRATED_VIEWER=true |
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,6 @@ | ||
node_modules | ||
.next/ | ||
.env.local | ||
.env.local | ||
|
||
# localstack data | ||
volume/ |
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,6 @@ | ||
import dotenv from "dotenv"; | ||
|
||
dotenv.config(); | ||
dotenv.config({ path: ".env.local", override: true }); | ||
|
||
console.log(`local-dev-${process.env.SOURCE}`); |
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,17 @@ | ||
services: | ||
# Azure Blob Storage emulator | ||
azure-storage: | ||
image: mcr.microsoft.com/azure-storage/azurite | ||
hostname: azurite | ||
restart: always | ||
command: "azurite --blobHost 0.0.0.0 --blobPort 10000 -l data" | ||
ports: | ||
- "10000:10000" | ||
|
||
# AWS S3 Storage emulator | ||
aws-storage: | ||
image: gresau/localstack-persist:3 | ||
ports: | ||
- "4566:4566" | ||
volumes: | ||
- "./volume:/persisted-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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.