Skip to content
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

Add local S3 support with MinIO #54

Merged
merged 10 commits into from
Apr 2, 2024
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
.idea
docker/data-source-tools/storage
docker/data-source-tools/storage/*

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ cd ./devop-tools/docker/data-source-services && docker-compose up --build -d
* Optionally included is the following tools:
* phpMyAdmin
* Mailpit
* MinIO

```bash
cd ./devop-tools/docker/data-source-tools && docker-compose up --build -d
Expand All @@ -62,6 +63,23 @@ _For mimicking an email inbox (ala mailtrap) for local usage._
* `MAIL_PASSWORD=null`
* `MAIL_ENCRYPTION=null`

### MinIO
_For running an S3 service locally._

* Edit the `/etc/hosts` file on your system and make a reference for `127.0.0.1 s3.docker`
iBotPeaches marked this conversation as resolved.
Show resolved Hide resolved
* Open the admin console http://s3.docker:10001 and login.
* username: root
* password: password
* Create an appropriate bucket for each project as needed.
* Modify the project's `.env` as follows:
* `FILESYSTEM_DRIVER=s3`
* `AWS_ACCESS_KEY_ID=root`
* `AWS_SECRET_ACCESS_KEY=password`
* `AWS_DEFAULT_REGION=us-east-1`
* `AWS_BUCKET=[project-bucket-name]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if DevopsToolKit is the right place for this, or if it'd be better in project initial setup or something once this gets added to template, but it'd be nice if this could spin up the initial bucket based on the env configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've set it up like that for previous projects, so if that's a direction we want to move, it shouldn't be an issue.

* `AWS_ENDPOINT=http://s3.docker:10000`
* `AWS_USE_PATH_STYLE_ENDPOINT=true`

---

## Scripts
Expand Down
15 changes: 15 additions & 0 deletions docker/data-source-tools/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ services:
MP_MAX_MESSAGES: 5000
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
minio:
hostname: s3.docker
image: minio/minio:latest
container_name: sourcetoad_minio
ports:
- "10000:10000"
- "10001:10001"
volumes:
- ./storage/data:/data
environment:
- MINIO_ROOT_USER=root
- MINIO_ROOT_PASSWORD=password
command: server /data/ --address :10000 --console-address :10001
networks:
- st-internal
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: sourcetoad_phpmyadmin
Expand Down