bsgrd
bsgrd

Reputation: 663

Laravel S3 connector (selfhosted S3 with docker)

I'm hosting my own S3Server on DigitalOcean using the Docker image scality/s3server

Previously i have been using Amazon S3 server, so i used the league/flysystem-aws-s3-v3 library for the connection.

Now, because i'm using my own server, i need to change the S3 endpoint that the connector use.

I have tried this configuration in the filesystems.php:

'disks' => [
    's3' => [
        'driver'    => 's3',
        'key'       => 'accessKey1',
        'secret'    => 'verySecretKey1',
        'bucket'    => 'mybucket',
        'base_url'  => 'http://my_digitalocean_ip:8000'
    ]
]

The connector still attempts to access https://s3.amazonaws.com/mybucket.

Does anyone know how to do that?

Upvotes: 1

Views: 1143

Answers (1)

bsgrd
bsgrd

Reputation: 663

I found the answer myself. The configuration option should be "endpoint" in stead of "base_url".

'disks' => [
    's3' => [
        'driver'    => 's3',
        'key'       => 'accessKey1',
        'secret'    => 'verySecretKey1',
        'bucket'    => 'mybucket',
        'endpoint'  => 'http://my_digitalocean_ip:8000'
    ]
]

Now it works.

I also chose to go with another storage system called minio. It's more intuitive i think, and it has a browserbased GUI.

Upvotes: 3

Related Questions