diff --git a/.env.local.example b/.env.local.example new file mode 100644 index 0000000..40e9437 --- /dev/null +++ b/.env.local.example @@ -0,0 +1,6 @@ +# Local Development MinIO Configuration +# Copy to .env.local and update with your MinIO credentials + +# MinIO credentials (get from your production server) +MINIO_KEY=your_minio_root_user +MINIO_SECRET=your_minio_root_password diff --git a/.env.minio.example b/.env.minio.example new file mode 100644 index 0000000..b24dd3c --- /dev/null +++ b/.env.minio.example @@ -0,0 +1,21 @@ +# MinIO S3 Storage Configuration +# Add these to your production .env file + +# MinIO Endpoint (internal Docker network) +MINIO_ENDPOINT=http://crew-minio-prod:9000 + +# MinIO Credentials (get from /var/www/apps/minio-storage/.env) +MINIO_KEY=your_minio_root_user +MINIO_SECRET=your_minio_root_password + +# Bucket name +MINIO_BUCKET=crewsportswear + +# Region (required for S3 compatibility) +MINIO_REGION=us-east-1 + +# Use path-style endpoint (required for MinIO) +MINIO_USE_PATH_STYLE=true + +# Public URL for accessing files (use your actual domain) +MINIO_URL=https://minio.crewsportswear.app diff --git a/app/helpers.php b/app/helpers.php new file mode 100644 index 0000000..12db958 --- /dev/null +++ b/app/helpers.php @@ -0,0 +1,33 @@ + 'local', 'root' => '/var/www/html/uploads/images', ], + + 'minio' => [ + 'driver' => 's3', + 'key' => env('MINIO_KEY'), + 'secret' => env('MINIO_SECRET'), + 'region' => env('MINIO_REGION', 'us-east-1'), + 'bucket' => env('MINIO_BUCKET', 'crewsportswear'), + 'endpoint' => env('MINIO_ENDPOINT'), + 'use_path_style_endpoint' => env('MINIO_USE_PATH_STYLE', true), + 'url' => env('MINIO_URL', 'https://minio.crewsportswear.app'), + ], + ], -]; +]; \ No newline at end of file diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 3f37cf0..d582ece 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -48,6 +48,14 @@ services: - ANALYTICS_SITE_ID= - ANALYTICS_CLIENT_ID= - ANALYTICS_SERVICE_EMAIL= + # MinIO S3 Storage (connect to production MinIO for testing) + - MINIO_ENDPOINT=https://minio.crewsportswear.app + - MINIO_KEY=${MINIO_KEY:-minioadmin} + - MINIO_SECRET=${MINIO_SECRET:-minioadmin} + - MINIO_BUCKET=crewsportswear + - MINIO_REGION=us-east-1 + - MINIO_USE_PATH_STYLE=false + - MINIO_URL=https://minio.crewsportswear.app volumes: - ./:/var/www/html - ./storage:/var/www/html/storage