Skip to content

Commit

Permalink
improve more
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Dec 13, 2023
1 parent 00d7086 commit 3c54e01
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 152 deletions.
5 changes: 0 additions & 5 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ You can ask for guidance anytime on our
- Run `spin up` - You can notice that errors will be thrown. Don't worry.
- If you see weird permission errors, especially on Mac, run `sudo spin up` instead.

If you are running Coolify for the first time:
- Run `./scripts/run dev:init` - This will delete any existing database layouts, migrate database to the new layout, and seed your database.

> If you see the login page with a 404 error, you forgot to run `./scripts/run dev:init`.
### 4) Start development
You can login your Coolify instance at `localhost:8000` with `[email protected]` and `password`.

Expand Down
33 changes: 33 additions & 0 deletions app/Console/Commands/Dev.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Console\Commands;

use App\Models\InstanceSettings;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Process;

class Dev extends Command
{
protected $signature = 'dev:init';
protected $description = 'Init the app in dev mode';

public function handle()
{
// Generate APP_KEY if not exists
if (empty(env('APP_KEY'))) {
echo "Generating APP_KEY.\n";
Artisan::call('key:generate');
}
// Seed database if it's empty
$settings = InstanceSettings::find(0);
if (!$settings) {
echo "Initializing instance, seeding database.\n";
Artisan::call('migrate --seed');
} else {
echo "Instance already initialized.\n";
}
// Set permissions
Process::run(['chmod', '-R', 'o+rwx', '.']);
}
}
28 changes: 0 additions & 28 deletions app/Http/Middleware/NOTUSEDIsBoardingFlow.php

This file was deleted.

45 changes: 0 additions & 45 deletions app/Http/Middleware/NOTUSEDIsSubscriptionValid.php

This file was deleted.

23 changes: 0 additions & 23 deletions database/factories/StandaloneMongoDBFactory.php

This file was deleted.

21 changes: 8 additions & 13 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,17 @@ services:
volumes:
- .:/var/www/html:cached
command: sh -c "npm install && npm run dev"
networks:
- coolify
testing-host:
<<: *testing-host-base
container_name: coolify-testing-host
volumes:
- /:/host
- /var/run/docker.sock:/var/run/docker.sock
- /data/coolify/:/data/coolify
# - coolify-data-dev:/data/coolify
# remote-host:
# <<: *testing-host-base
# container_name: coolify-remote-host
# volumes:
# - /:/host
# - /var/run/docker.sock:/var/run/docker.sock
# - /data/coolify/:/data/coolify
# # - coolify-data-dev:/data/coolify
networks:
- coolify
mailpit:
image: "axllent/mailpit:latest"
container_name: coolify-mail
Expand Down Expand Up @@ -116,8 +111,8 @@ volumes:
coolify-redis-data-dev:
coolify-minio-data-dev:


networks:
coolify:
name: coolify
driver: bridge
external: false
coolify:
name: coolify
external: false
3 changes: 2 additions & 1 deletion docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/command/execlineb -P
foreground { composer -d /var/www/html/ install }
foreground { php /var/www/html/artisan key:generate }
foreground { php /var/www/html/artisan migrate --step }
foreground { php /var/www/html/artisan dev:init }

74 changes: 37 additions & 37 deletions scripts/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,50 @@ function help {
compgen -A function | cat -n
}

function dev:init {
docker exec coolify bash -c "php artisan migrate --seed"
echo "Need to update privileges on a few files. I need your password for that."
sudo chmod -R o+rwx .
}

function sync:v3 {
if [ -z "$1" ]; then
echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32"
exit 1
fi
skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1
}
# function dev:init {
# docker exec coolify bash -c "php artisan migrate --seed"
# echo "Need to update privileges on a few files. I need your password for that."
# sudo chmod -R o+rwx .
# }

# function sync:v3 {
# if [ -z "$1" ]; then
# echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32"
# exit 1
# fi
# skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1
# }
function sync:bunny {
php artisan sync:bunny --env=secrets
}

function queue {
bash spin exec -u webuser coolify php artisan queue:listen
}
# function queue {
# bash spin exec -u webuser coolify php artisan queue:listen
# }

function horizon {
bash spin exec -u webuser coolify php artisan horizon -vvv
}
# function horizon {
# bash spin exec -u webuser coolify php artisan horizon -vvv
# }

function schedule {
bash spin exec -u webuser coolify php artisan schedule:work
}
# function schedule {
# bash spin exec -u webuser coolify php artisan schedule:work
# }

function schedule:run {
bash spin exec -u webuser coolify php artisan schedule:run
}
# function schedule:run {
# bash spin exec -u webuser coolify php artisan schedule:run
# }


function db {
bash spin exec -u webuser coolify php artisan db
}
function db:seed {
bash spin exec -u webuser coolify php artisan migrate --seed
}
# function db {
# bash spin exec -u webuser coolify php artisan db
# }
# function db:seed {
# bash spin exec -u webuser coolify php artisan migrate --seed
# }

function db:migrate {
bash spin exec -u webuser coolify php artisan migrate --step
}
# function db:migrate {
# bash spin exec -u webuser coolify php artisan migrate --step
# }

function db:reset {
bash spin exec -u webuser coolify php artisan migrate:fresh --seed
Expand Down Expand Up @@ -101,9 +101,9 @@ function tinker {
}


function build:helper {
act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets
}
# function build:helper {
# act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets
# }
function default {
help
}
Expand Down

0 comments on commit 3c54e01

Please sign in to comment.