Skip to content

Commit

Permalink
Merge pull request #315 from EscolaLMS/feature/minio_s3
Browse files Browse the repository at this point in the history
Feature/minio s3
  • Loading branch information
qunabu authored Feb 16, 2024
2 parents 4dcde9b + 7161fda commit 062c681
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 8 deletions.
15 changes: 13 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APP_ENV=local
APP_KEY=base64:pveos6JL8iCwO3MbzoyQpNx6TETMYuUpfZ18CDKl6Cw=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:1000
APP_URL=http://api.localhost:1001

DB_CONNECTION=pgsql
DB_HOST=postgres
Expand Down Expand Up @@ -50,4 +50,15 @@ MJML_BINARY_PATH=/usr/bin/mjml

TRACKER_ENABLED=false

REPORTBRO_URL="https://www.reportbro.com/report/run"
REPORTBRO_URL="https://www.reportbro.com/report/run"


FILESYSTEM_DRIVER=s3

AWS_ACCESS_KEY_ID=masoud
AWS_SECRET_ACCESS_KEY=tg9t712TG1Odn17fisxXM9y01YrD
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=wellms
AWS_ENDPOINT="http://minio:9000"
AWS_URL="http://storage.localhost:1001/wellms"
AWS_USE_PATH_STYLE_ENDPOINT=true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM escolalms/php:8.1-prod
FROM escolalms/php:8.2-prod
WORKDIR /var/www/html
EXPOSE 80
COPY / /var/www/html
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"laravel/passport": "^11",
"laravel/socialite": "^5.1",
"laravel/tinker": "^2.9",
"league/flysystem-aws-s3-v3": "^3.0",
"predis/predis": "^2.2",
"psr/http-message": "^1",
"sentry/sentry-laravel": "^4.2",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@
'local' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],

'testing' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],

Expand All @@ -71,6 +71,10 @@
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),


],

],
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,22 @@ services:
networks:
- escola_lms
image: escolalms/reportbro-server:latest

minio:
image: bitnami/minio
networks:
- escola_lms
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./docker/minio_storage:/data
- ./docker/conf/minio:/docker-entrypoint-initdb.d
environment:
MINIO_DEFAULT_BUCKETS: "${AWS_BUCKET}:download"
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_BUCKET: ${AWS_BUCKET}
AWS_ENDPOINT: ${AWS_ENDPOINT}
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/postgres-data
/postgres-backups
/pgadmin
/minio_storage
11 changes: 10 additions & 1 deletion docker/conf/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

http://localhost:1001 {
http://api.localhost:1001 {
# Resolve the root directory for the app
root * /var/www/html/public

Expand Down Expand Up @@ -32,3 +32,12 @@ http://localhost:1001 {

}

http://storage.localhost:1001 {
reverse_proxy minio:9000
}

http://minio.localhost:1001 {
reverse_proxy minio:9001
}


0 comments on commit 062c681

Please sign in to comment.