wip
This commit is contained in:
parent
38315492a2
commit
408236b6b1
23
.dockerignore
Normal file
23
.dockerignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/vendor
|
||||||
|
.env
|
||||||
|
.env.backup
|
||||||
|
.env.production
|
||||||
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
auth.json
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
/.npm
|
||||||
|
/.bash_history
|
||||||
|
/_volumes/*
|
||||||
|
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Actions\Fortify;
|
namespace App\Actions\Fortify;
|
||||||
|
|
||||||
|
use App\Models\Team;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
@ -31,10 +33,21 @@ class CreateNewUser implements CreatesNewUsers
|
|||||||
'password' => $this->passwordRules(),
|
'password' => $this->passwordRules(),
|
||||||
])->validate();
|
])->validate();
|
||||||
|
|
||||||
return User::create([
|
$team = Team::create([
|
||||||
|
'name' => explode(' ', $input['name'], 2)[0] . "'s Team",
|
||||||
|
'personal_team' => true,
|
||||||
|
'is_root_user' => User::count() == 0 ? true : false,
|
||||||
|
]);
|
||||||
|
$user = User::create([
|
||||||
'name' => $input['name'],
|
'name' => $input['name'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
'password' => Hash::make($input['password']),
|
'password' => Hash::make($input['password']),
|
||||||
]);
|
]);
|
||||||
|
DB::table('team_user')->insert([
|
||||||
|
'team_id' => $user->id,
|
||||||
|
'user_id' => $team->id,
|
||||||
|
'role' => 'admin',
|
||||||
|
]);
|
||||||
|
return $user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,49 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
coolify:
|
coolify:
|
||||||
|
container_name: coolify
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./docker/prod-ssu/Dockerfile
|
dockerfile: ./docker/prod-ssu/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
AUTORUN_LARAVEL_STORAGE_LINK: "true"
|
- APP_ENV=production
|
||||||
AUTORUN_LARAVEL_MIGRATION: "true"
|
- APP_DEBUG
|
||||||
env_file:
|
- APP_NAME
|
||||||
- .env
|
- APP_KEY
|
||||||
|
- APP_URL
|
||||||
|
- DB_CONNECTION
|
||||||
|
- DB_HOST
|
||||||
|
- DB_PORT
|
||||||
|
- DB_DATABASE
|
||||||
|
- DB_USERNAME
|
||||||
|
- DB_PASSWORD
|
||||||
|
- QUEUE_CONNECTION
|
||||||
|
- SSL_MODE=off
|
||||||
|
- AUTORUN_LARAVEL_MIGRATION=true
|
||||||
|
ports:
|
||||||
|
- "${APP_PORT:-8000}:80"
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
postgres:
|
postgres:
|
||||||
|
container_name: coolify-db
|
||||||
|
volumes:
|
||||||
|
- coolify-db:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "${DB_USERNAME}"
|
POSTGRES_USER: "${DB_USERNAME}"
|
||||||
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
||||||
POSTGRES_DB: "${DB_DATABASE}"
|
POSTGRES_DB: "${DB_DATABASE}"
|
||||||
env_file:
|
healthcheck:
|
||||||
- .env
|
test:
|
||||||
|
[
|
||||||
|
"CMD-SHELL",
|
||||||
|
"pg_isready -U ${DB_USERNAME}",
|
||||||
|
"-d",
|
||||||
|
"${DB_DATABASE}"
|
||||||
|
]
|
||||||
|
interval: 2s
|
||||||
|
retries: 5
|
||||||
|
timeout: 2s
|
||||||
|
volumes:
|
||||||
|
coolify-db:
|
||||||
|
name: coolify-db
|
||||||
|
@ -6,6 +6,7 @@ services:
|
|||||||
- coolify
|
- coolify
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15-alpine
|
image: postgres:15-alpine
|
||||||
networks:
|
networks:
|
||||||
|
@ -1,8 +1,21 @@
|
|||||||
|
FROM node:19 as static-assets
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
FROM serversideup/php:8.2-fpm-nginx
|
FROM serversideup/php:8.2-fpm-nginx
|
||||||
|
WORKDIR /var/www/html
|
||||||
ARG POSTGRES_VERSION=15
|
ARG POSTGRES_VERSION=15
|
||||||
RUN apt-get update && apt-get install -y php-pgsql openssh-client
|
RUN apt-get update && apt-get install -y php-pgsql openssh-client git git-lfs
|
||||||
RUN apt-get -y autoremove \
|
RUN apt-get -y autoremove \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
|
||||||
|
|
||||||
COPY --chmod=755 docker/dev-ssu/etc/s6-overlay/ /etc/s6-overlay/
|
COPY --chmod=755 docker/prod-ssu/etc/s6-overlay/ /etc/s6-overlay/
|
||||||
|
COPY --chown=9999:9999 . .
|
||||||
|
COPY --from=static-assets --chown=9999:9999 /app/public/build /var/www/html/public/build
|
||||||
|
|
||||||
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
RUN php artisan route:cache
|
||||||
|
RUN php artisan view:cache
|
||||||
|
Loading…
x
Reference in New Issue
Block a user