packages/plugin-cloud-storage/docs/local-dev.md
This repository includes a local development environment for local testing and development of this plugin. To run the local sandbox, follow the instructions below.
yarn in both the root folder of the repo, and the ./dev foldercd into ./dev and run cp .env.example .env to create an .env file./dev/.env file and completely fill out each propertyThis repository comes with a Docker emulator for Azure Blob Storage.
If you would like to test locally with an emulated blob storage container, you can cd into ./src/adapters/azure/emulator and then run docker-compose up -d.
The default ./dev/.env.example file comes pre-loaded with correct env variables that correspond to the Azure Docker emulator.
Otherwise, if you are not using the emulator, make sure your environment variables within ./dev/.env are configured for your Azure connection.
Finally, to start the Payload dev server with the Azure adapter, run yarn dev:azure and then open http://localhost:3000/admin in your browser.
This repository also includes a Docker LocalStack emulator for S3. It requires a few more steps to get up and running.
To use the S3 emulator, use the following steps:
awscli installed. On Mac, run brew install awscli to get started.region will need to match. To create a dummy profile for LocalStack, type aws configure --profile localstack. Use the access key and secret from the ./dev/.env.example and use region us-east-1../src/adapters/s3/emulator folder and running docker-compose up -d.aws --endpoint-url=http://localhost:4566 s3 mb s3://payload-bucket. Note that our bucket is called payload-bucket.aws --endpoint-url=http://localhost:4566 s3api put-bucket-acl --bucket payload-bucket --acl public-readFinally, you can run yarn dev:s3 and then open http://localhost:3000/admin in your browser.
This repository comes with a Docker emulator for Google Cloud Storage.
If you would like to test locally with an emulated GCS container, you can cd into ./src/adapters/gcs/emulator and then run docker-compose up -d.
The default ./dev/.env.example file comes pre-loaded with correct env variables that correspond to the GCS Docker emulator.
Otherwise, if you are not using the emulator, make sure your environment variables within ./dev/.env are configured for your Google connection.
Finally, to start the Payload dev server with the GCS adapter, run yarn dev:gcs and then open http://localhost:3000/admin in your browser.