Compare commits

...

3 Commits

6 changed files with 23 additions and 6 deletions

View File

@ -38,4 +38,9 @@ public static function shortDigest(string $digest): string
$digest = Str::of($digest)->explode(':', 2)->last();
return Str::of($digest)->take(12)->toString();
}
public static function dockerServiceAddress(): string
{
return Str::of(config('registry.service_http'))->remove(['http://', 'https://'])->toString();
}
}

View File

@ -5,6 +5,7 @@
use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\AccessTokens\StoreUpdate;
use App\Enums\AccessTokenPermission;
use App\Helpers\Helpers;
use App\Models\User;
use App\Repositories\AccessTokenRepository;
use App\ServiceResults\ServiceResultArray;
@ -39,7 +40,7 @@ public function create(User $user): ServiceResultError | ServiceResultArray
{
return $this->result([
'user' => $user,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
'permissions' => AccessTokenPermission::toCollection()->pluck('title', 'value')->toArray(),
]);
}

View File

@ -5,6 +5,7 @@
use App\Dto\Builder\Repository as RepositoryBuilder;
use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\Repository\StoreUpdate;
use App\Helpers\Helpers;
use App\Models\Repository;
use App\Models\User;
use App\Repositories\RepositoryRepository;
@ -65,7 +66,7 @@ public function repository(string $username, string $repositoryName, ?User $user
return $this->result([
'repository' => $repository,
'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
]);
}

View File

@ -3,6 +3,7 @@
namespace App\Services\Site;
use App\Dto\QuerySettingsDto;
use App\Helpers\Helpers;
use App\Models\User;
use App\Repositories\RepositoryRepository;
use App\Repositories\TagRepositoryRepository;
@ -55,7 +56,7 @@ public function tags(string $username, string $repositoryName, QuerySettingsDto
'tags' => $tags,
'repository' => $repository,
'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'),
'serviceAddress' => Helpers::dockerServiceAddress(),
]);
}

View File

@ -12,6 +12,9 @@ services:
- captcha-app
ports:
- ${DOCKER_APP_PORT}:9000
environment:
CONTAINER_ROLE: app
UNIT_SOURCE: '"172.16.0.0/12"'
volumes:
- ./app/application:/var/www/html
- ./certs:/var/www/html/resources/certs:ro

View File

@ -1,7 +1,8 @@
version: '3.7'
services:
app:
image: korelf/mdhub:0.1.0-beta
# image: korelf/mdhub:0.1.0-beta # docker hub
image: docker.mdhub.kor-elf.net/kor-elf/mdhub:0.1.0-beta #MDHub
# restart: always
depends_on:
- db
@ -10,12 +11,16 @@ services:
ports:
- ${DOCKER_APP_PORT}:9000
env_file: app/.env
environment:
CONTAINER_ROLE: app
UNIT_SOURCE: '"172.16.0.0/12"'
volumes:
- ./app/storage/app:/var/www/html/storage/app
- ./app/storage/logs:/var/www/html/storage/logs
- ./certs:/var/www/html/resources/certs:ro
queue:
image: korelf/mdhub:0.1.0-beta
# image: korelf/mdhub:0.1.0-beta # docker hub
image: docker.mdhub.kor-elf.net/kor-elf/mdhub:0.1.0-beta #MDHub
# restart: always
depends_on:
- db
@ -28,7 +33,8 @@ services:
- ./app/storage/logs:/var/www/html/storage/logs
- ./certs:/var/www/html/resources/certs:ro
scheduler:
image: korelf/mdhub:0.1.0-beta
# image: korelf/mdhub:0.1.0-beta # docker hub
image: docker.mdhub.kor-elf.net/kor-elf/mdhub:0.1.0-beta #MDHub
# restart: always
depends_on:
- db