Skip to content

Commit

Permalink
Use app proxy for minio
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoy committed Mar 7, 2021
1 parent d32d799 commit bfe41dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ On first run, and when updating, you'll need to run migrations:

I strongly recommend taking a backup of your volumes before migrating to avoid any potential data loss.

RecipeSage _really_ depends on AWS S3 for image storage, but I've stubbed in fake S3 via Minio. I _highly_ suggest setting up an AWS account with S3 and using that rather than Minio. That said, Minio seems to work just fine in my limited testing, so YMMV. If you're using minio will want to set `AWS_S3_PUBLIC_PATH` to the public address at which the minio bucket is reachable (`http://localhost:9000/recipesage-selfhost/` by default).
RecipeSage _really_ depends on AWS S3 for image storage, but I've stubbed in fake S3 via Minio. I _highly_ suggest setting up an AWS account with S3 and using that rather than Minio. That said, Minio seems to work just fine in my limited testing, so YMMV.

If you're not going to use minio, and are going to use S3 proper, you'll want to remove the minio-specific environment variables (marked with comments), and plug in your AWS credentials.

You'll likely want to put this behind some type of reverse proxy (I recommend nginx) to add SSL (I recommend Lets Encrypt). As-is, the container consumes port 80 on the host system. You can easily change that to another host port as desired.

## Changelog

### v1.1.0

Move minio behind app proxy.

**Note:** If you're upgrading from an earlier version of these selfhost configs, you'll need to make sure to continue to expose 9000 on the Minio container in order to maintain access to images uploaded before this change, **or** update the image path in the DB.

### v1.0.0

Initial release.

4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- AWS_REGION=us-west-2
- AWS_BUCKET=recipesage-selfhost
- AWS_ENDPOINT=http://minio:9000/ # Needed for minio, remove for s3 - should be the internal container address to minio
- AWS_S3_PUBLIC_PATH=http://localhost:9000/recipesage-selfhost/ # Needed for minio, remove for s3 - should be a public facing address/path directed to minio
- AWS_S3_PUBLIC_PATH=/minio/recipesage-selfhost/ # Needed for minio, remove for s3 - should be a public facing address/path directed to minio (by default nginx proxy handles)
- AWS_S3_FORCE_PATH_STYLE=true # Needed for minio, remove for s3
- AWS_S3_SIGNATURE_VERSION=v4 # Needed for minio, remove for s3
- NODE_ENV=selfhost
Expand Down Expand Up @@ -93,8 +93,6 @@ services:
restart: unless-stopped
minio:
image: minio/minio
ports:
- 9000:9000
environment:
- MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
- MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Expand Down
5 changes: 5 additions & 0 deletions proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ server {
proxy_pass http://pushpin:7999/ws;
}

location /minio/ {
resolver 127.0.0.11 valid=30s;
proxy_pass http://minio:9000/;
}

location /api/ {
resolver 127.0.0.11 valid=30s;
proxy_pass http://api:3000/;
Expand Down

0 comments on commit bfe41dd

Please sign in to comment.