-
Notifications
You must be signed in to change notification settings - Fork 6
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
Run locally without acess aws s3 #9
Comments
I've tried to implement it in docker compose, but I haven't tested it yet because I don't know how to automate the creation of the bucket. version: '3.8'
services:
redis:
image: redis:6.2-alpine
container_name: shipthing-redis
restart: always
ports:
- '6379:6379'
command: redis-server --loglevel warning --requirepass passwd
minio:
image: quay.io/minio/minio
container_name: shipthing-minio-storage
environment:
MINIO_ROOT_USER: minioroot
MINIO_ROOT_PASSWORD: secret-password
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio-storage:/data
command: server /data --console-address ':9001'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
volumes:
minio-storage:
|
i think you need the minio cli to create the bucket inside the docker container |
I found this on stack overflow and, in my tests, it works well. version: '3.8'
services:
# redis instance
minio:
image: quay.io/minio/minio
container_name: shipthing-minio-storage
environment:
MINIO_ROOT_USER: shipthing
MINIO_ROOT_PASSWORD: secret-password
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio-storage:/data
command: server /data --console-address ':9001'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set shipthing http://minio:9000 shipthing secret-password;
/usr/bin/mc mb shipthing/shipthing;
/usr/bin/mc policy set public shipthing/shipthing;
exit 0;
"
volumes:
minio-storage:
|
I'm researching how to connect to the local instance without breaking all the code, I found this solution:
AWS_BUCKET_NAME="shipthing"
AWS_REGION="us-east-1"
AWS_ENDPOINT="http://localhost:9000"
REDIS_ADDR="localhost:6379"
REDIS_PASSWORD="passwd"
SECRET_KEY=""
ACCESS_KEY=""
func createAwsSession() (*session.Session, error) {
sesh, err := session.NewSession(&aws.Config{
Region: aws.String(os.Getenv("AWS_REGION")),
Endpoint: aws.String(os.Getenv("AWS_ENDPOINT")),
Credentials: credentials.NewStaticCredentials(
os.Getenv("ACCESS_KEY"),
os.Getenv("SECRET_KEY"),
"",
),
}) however, after doing this, but when a request to I'm not a golang dev 😅, so I don't know how to solve it. |
Hey all, really good point! That will make it easier to test things and don't spend free tier accounts! That said, I think we can might do is creating an Abstract S3 Service and implement two versions:
We can use the I think that we can also create a parameter on the I'm also open for better suggestions! |
Would |
@meiazero I think it would be an interface that would be implemented by |
That's right @jotace1. So it would be one connecting to minio, and the other to s3! |
is minio a must? I mean, there are others like localstack (I'm personally more familiar with localstack) |
nope, if you wanna tackle it feel free to go with localstack :) |
I quickly read about localstack and it seems more pleasant to use than minio. |
yeah, I think using localstack can perhaps avoid the need for a mocked class. I'll work on that |
tyvm! godspeed |
Is it possible to use Minio in Docker Compose to emulate s3 and thus run it locally?
The text was updated successfully, but these errors were encountered: