dockerize app
This commit is contained in:
57
.dockerignore
Normal file
57
.dockerignore
Normal file
@@ -0,0 +1,57 @@
|
||||
# Ignore version control system directories
|
||||
.git
|
||||
.gitignore
|
||||
.gitattributes
|
||||
|
||||
# Ignore development and build files
|
||||
node_modules
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
*.log
|
||||
*.cache
|
||||
|
||||
# Ignore environment files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore editor and IDE files
|
||||
.idea
|
||||
.vscode
|
||||
*.swp
|
||||
*.swo
|
||||
*.sublime-*
|
||||
|
||||
# Ignore testing and documentation
|
||||
tests
|
||||
phpunit.xml
|
||||
README.md
|
||||
CHANGELOG.md
|
||||
LICENSE
|
||||
|
||||
# Ignore other unnecessary files
|
||||
*.md
|
||||
*.yml
|
||||
*.yaml
|
||||
.editorconfig
|
||||
.styleci.yml
|
||||
phpstan.neon
|
||||
psalm.xml
|
||||
|
||||
# Ignore backup files
|
||||
*.bak
|
||||
*.backup
|
||||
|
||||
# Ignore Docker related files (except Dockerfile)
|
||||
docker-compose*.yml
|
||||
.dockerignore
|
||||
|
||||
# Ignore Laravel specific files that are not needed in production
|
||||
storage/framework/cache/*
|
||||
storage/framework/sessions/*
|
||||
storage/framework/views/*
|
||||
storage/logs/*
|
||||
bootstrap/cache/*
|
||||
|
||||
# Keep .gitkeep files to preserve directory structure
|
||||
!.gitkeep
|
||||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM serversideup/php:8.3-fpm-nginx
|
||||
|
||||
ENV PHP_OPCACHE_ENABLE=1
|
||||
|
||||
USER root
|
||||
|
||||
# Install Node.js
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y nodejs \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy application files
|
||||
COPY --chown=www-data:www-data . /var/www/html
|
||||
|
||||
# Switch to non-root user
|
||||
USER www-data
|
||||
|
||||
# Install dependencies and build
|
||||
RUN npm ci \
|
||||
&& npm run build \
|
||||
&& rm -rf /var/www/html/.npm
|
||||
|
||||
# Install PHP dependencies
|
||||
RUN composer install --no-interaction --optimize-autoloader --no-dev
|
||||
|
||||
# Remove composer cache
|
||||
RUN rm -rf /var/www/html/.composer/cache
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasFactory, Notifiable;
|
||||
use HasFactory, Notifiable, MustVerifyEmail;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
||||
Reference in New Issue
Block a user