Skip to content

Commit

Permalink
Proxy Traefik v2 gets running.
Browse files Browse the repository at this point in the history
  • Loading branch information
ijpatricio committed May 3, 2023
1 parent cc51b1d commit aeacd7c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions .env.development.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Run in your terminal: `id -u` and `id -g` and that's the results
USERID=
GROUPID=
PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify
############################################################################################################

APP_NAME=Coolify
Expand Down
2 changes: 2 additions & 0 deletions _testing_hosts/host_2_proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
20 changes: 14 additions & 6 deletions app/Actions/Proxy/InstallProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ public function __invoke(Server $server)
);

$activity = remoteProcess([
'mkdir -p proxy',
'mkdir -p proxy/letsencrypt',
'cd proxy',
'mkdir -p projects',
'mkdir -p projects/proxy',
'mkdir -p projects/proxy/letsencrypt',
'cd projects/proxy',
"echo '$docker_compose_yml_base64' | base64 -d > docker-compose.yml",
"echo '$env_file_base64' | base64 -d > .env",
'cat .env',
'docker compose up -d --remove-orphans',
'docker ps',
], $server, ActivityTypes::INLINE->value);

return $activity;
Expand All @@ -40,6 +42,12 @@ protected function getDockerComposeContents()
*/
protected function getComposeData(): array
{
$cwd = config('app.env') === 'local'
? config('coolify.project_path_on_host') . '_testing_hosts/host_2_proxy'
: '.';

ray($cwd);

return [
"version" => "3.7",
"networks" => [
Expand All @@ -64,8 +72,8 @@ protected function getComposeData(): array
],
"volumes" => [
"/var/run/docker.sock:/var/run/docker.sock:ro",
"./letsencrypt:/letsencrypt",
"./traefik.auth:/auth/traefik.auth",
"{$cwd}/letsencrypt:/letsencrypt",
"{$cwd}/traefik.auth:/auth/traefik.auth",
],
"command" => [
"--api.dashboard=true",
Expand Down
2 changes: 2 additions & 0 deletions config/coolify.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

return [
'version' => '4.0.0-nightly.1',

'project_path_on_host' => env('PROJECT_PATH_ON_HOST', '/var/www/html')
];
10 changes: 6 additions & 4 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ x-testing-host: &testing-host-base
build:
dockerfile: Dockerfile
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:
- coolify

Expand Down Expand Up @@ -52,9 +49,14 @@ services:
testing-host:
<<: *testing-host-base
container_name: coolify-testing-host
testing-host2:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
testing-host-2:
<<: *testing-host-base
container_name: coolify-testing-host-2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "./_testing_hosts/host_2_proxy:/root/projects/proxy"



0 comments on commit aeacd7c

Please sign in to comment.