Proxy Traefik v2 gets running.

This commit is contained in:
Joao Patricio 2023-05-03 13:05:31 +01:00
parent cc51b1d394
commit aeacd7cf34
5 changed files with 25 additions and 10 deletions

View File

@ -5,6 +5,7 @@
# Run in your terminal: `id -u` and `id -g` and that's the results # Run in your terminal: `id -u` and `id -g` and that's the results
USERID= USERID=
GROUPID= GROUPID=
PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify
############################################################################################################ ############################################################################################################
APP_NAME=Coolify APP_NAME=Coolify

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -19,12 +19,14 @@ public function __invoke(Server $server)
); );
$activity = remoteProcess([ $activity = remoteProcess([
'mkdir -p proxy', 'mkdir -p projects',
'mkdir -p proxy/letsencrypt', 'mkdir -p projects/proxy',
'cd proxy', 'mkdir -p projects/proxy/letsencrypt',
'cd projects/proxy',
"echo '$docker_compose_yml_base64' | base64 -d > docker-compose.yml", "echo '$docker_compose_yml_base64' | base64 -d > docker-compose.yml",
"echo '$env_file_base64' | base64 -d > .env", "echo '$env_file_base64' | base64 -d > .env",
'cat .env', 'docker compose up -d --remove-orphans',
'docker ps',
], $server, ActivityTypes::INLINE->value); ], $server, ActivityTypes::INLINE->value);
return $activity; return $activity;
@ -40,6 +42,12 @@ protected function getDockerComposeContents()
*/ */
protected function getComposeData(): array protected function getComposeData(): array
{ {
$cwd = config('app.env') === 'local'
? config('coolify.project_path_on_host') . '_testing_hosts/host_2_proxy'
: '.';
ray($cwd);
return [ return [
"version" => "3.7", "version" => "3.7",
"networks" => [ "networks" => [
@ -64,8 +72,8 @@ protected function getComposeData(): array
], ],
"volumes" => [ "volumes" => [
"/var/run/docker.sock:/var/run/docker.sock:ro", "/var/run/docker.sock:/var/run/docker.sock:ro",
"./letsencrypt:/letsencrypt", "{$cwd}/letsencrypt:/letsencrypt",
"./traefik.auth:/auth/traefik.auth", "{$cwd}/traefik.auth:/auth/traefik.auth",
], ],
"command" => [ "command" => [
"--api.dashboard=true", "--api.dashboard=true",

View File

@ -2,4 +2,6 @@
return [ return [
'version' => '4.0.0-nightly.1', 'version' => '4.0.0-nightly.1',
'project_path_on_host' => env('PROJECT_PATH_ON_HOST', '/var/www/html')
]; ];

View File

@ -5,9 +5,6 @@ x-testing-host: &testing-host-base
build: build:
dockerfile: Dockerfile dockerfile: Dockerfile
context: ./docker/testing-host context: ./docker/testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks: networks:
- coolify - coolify
@ -52,9 +49,14 @@ services:
testing-host: testing-host:
<<: *testing-host-base <<: *testing-host-base
container_name: coolify-testing-host container_name: coolify-testing-host
testing-host2: volumes:
- /var/run/docker.sock:/var/run/docker.sock
testing-host-2:
<<: *testing-host-base <<: *testing-host-base
container_name: coolify-testing-host-2 container_name: coolify-testing-host-2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "./_testing_hosts/host_2_proxy:/root/projects/proxy"