generated from Tokal/Test
Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ae07994cf | ||
|
|
dcbb0548e8 | ||
|
|
606eb53566 | ||
|
|
0b8408dbfe | ||
|
|
c4727b74ff | ||
|
|
97775b8bef | ||
|
|
ddddfe4b9d | ||
|
|
9730598e68 | ||
|
|
d97f6b676b | ||
|
|
8b09f77bcb | ||
|
|
158010b05c | ||
|
|
fc377b47a1 | ||
|
|
646fd8f8cf | ||
|
|
60bbf14ec7 | ||
|
|
2a7c74bceb | ||
|
|
749b083a1f | ||
|
|
2d1886462a | ||
|
|
b00626bd7a | ||
|
|
86b9ba033b | ||
|
|
34e152fd90 |
@@ -0,0 +1,65 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
APP_LOCALE=en
|
||||||
|
APP_FALLBACK_LOCALE=en
|
||||||
|
APP_FAKER_LOCALE=en_US
|
||||||
|
|
||||||
|
APP_MAINTENANCE_DRIVER=file
|
||||||
|
# APP_MAINTENANCE_STORE=database
|
||||||
|
|
||||||
|
# PHP_CLI_SERVER_WORKERS=4
|
||||||
|
|
||||||
|
BCRYPT_ROUNDS=12
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
LOG_STACK=single
|
||||||
|
LOG_DEPRECATIONS_CHANNEL=null
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
|
DB_CONNECTION=pgsql
|
||||||
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_DATABASE=tabeley_db
|
||||||
|
DB_USERNAME=postgres
|
||||||
|
DB_PASSWORD=secret
|
||||||
|
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
SESSION_ENCRYPT=false
|
||||||
|
SESSION_PATH=/
|
||||||
|
SESSION_DOMAIN=null
|
||||||
|
|
||||||
|
BROADCAST_CONNECTION=log
|
||||||
|
FILESYSTEM_DISK=local
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
|
||||||
|
CACHE_STORE=file
|
||||||
|
# CACHE_PREFIX=
|
||||||
|
|
||||||
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
|
REDIS_CLIENT=phpredis
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=log
|
||||||
|
MAIL_SCHEME=null
|
||||||
|
MAIL_HOST=127.0.0.1
|
||||||
|
MAIL_PORT=2525
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||||
|
|
||||||
|
VITE_APP_NAME="${APP_NAME}"
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
FROM php:8.3-fpm
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
libpq-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
unzip \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
zip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install -j"$(nproc)" pdo_pgsql pgsql intl gd zip
|
||||||
|
|
||||||
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
WORKDIR /var/www
|
||||||
|
|
||||||
|
COPY composer.json composer.lock ./
|
||||||
|
RUN composer install --no-dev --prefer-dist --no-interaction --no-scripts --optimize-autoloader
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN chown -R www-data:www-data storage bootstrap/cache \
|
||||||
|
&& chmod -R ug+rw storage bootstrap/cache \
|
||||||
|
&& chmod +x docker/entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker/entrypoint.sh"]
|
||||||
|
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
CMD ["php-fpm"]
|
||||||
@@ -11,17 +11,9 @@ services:
|
|||||||
APP_ENV: production
|
APP_ENV: production
|
||||||
APP_DEBUG: "false"
|
APP_DEBUG: "false"
|
||||||
APP_URL: ${APP_URL:-http://127.0.0.1:8000}
|
APP_URL: ${APP_URL:-http://127.0.0.1:8000}
|
||||||
DB_CONNECTION: pgsql
|
|
||||||
DB_HOST: db
|
|
||||||
DB_PORT: 5432
|
|
||||||
DB_DATABASE: ${DB_DATABASE:-tabeley_db}
|
|
||||||
DB_USERNAME: ${DB_USERNAME:-postgres}
|
|
||||||
DB_PASSWORD: ${DB_PASSWORD:-secret}
|
|
||||||
RUN_MIGRATIONS: "true"
|
RUN_MIGRATIONS: "true"
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
volumes:
|
volumes:
|
||||||
- storage_data:/var/www/html/storage
|
- storage_data:/var/www/storage
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:1.27-alpine
|
image: nginx:1.27-alpine
|
||||||
@@ -32,7 +24,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./public:/var/www/html/public:ro
|
- ./public:/var/www/public:ro
|
||||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
|
||||||
db:
|
db:
|
||||||
@@ -3,14 +3,11 @@ set -e
|
|||||||
|
|
||||||
cd /var/www
|
cd /var/www
|
||||||
|
|
||||||
echo "🚀 Starting Tabeley Production Container..."
|
|
||||||
|
|
||||||
# Create .env if not exists
|
|
||||||
if [ ! -f .env ]; then
|
if [ ! -f .env ]; then
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to safely update env values
|
# Update .env keys from runtime environment variables when provided.
|
||||||
set_env() {
|
set_env() {
|
||||||
key="$1"
|
key="$1"
|
||||||
value="$2"
|
value="$2"
|
||||||
@@ -23,38 +20,30 @@ set_env() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Inject runtime environment variables
|
|
||||||
set_env DB_CONNECTION "${DB_CONNECTION}"
|
set_env DB_CONNECTION "${DB_CONNECTION}"
|
||||||
set_env DB_HOST "${DB_HOST}"
|
set_env DB_HOST "${DB_HOST}"
|
||||||
set_env DB_PORT "${DB_PORT}"
|
set_env DB_PORT "${DB_PORT}"
|
||||||
set_env DB_DATABASE "${DB_DATABASE}"
|
set_env DB_DATABASE "${DB_DATABASE}"
|
||||||
set_env DB_USERNAME "${DB_USERNAME}"
|
set_env DB_USERNAME "${DB_USERNAME}"
|
||||||
set_env DB_PASSWORD "${DB_PASSWORD}"
|
set_env DB_PASSWORD "${DB_PASSWORD}"
|
||||||
|
set_env DB_URL "${DB_URL}"
|
||||||
set_env DATABASE_URL "${DATABASE_URL}"
|
set_env DATABASE_URL "${DATABASE_URL}"
|
||||||
set_env APP_ENV "${APP_ENV}"
|
set_env APP_ENV "${APP_ENV}"
|
||||||
set_env APP_DEBUG "${APP_DEBUG}"
|
set_env APP_DEBUG "${APP_DEBUG}"
|
||||||
set_env APP_URL "${APP_URL}"
|
set_env APP_URL "${APP_URL}"
|
||||||
|
|
||||||
# Laravel setup
|
|
||||||
php artisan config:clear || true
|
php artisan config:clear || true
|
||||||
|
if ! grep -q "^APP_KEY=base64:" .env; then
|
||||||
if [ -z "$APP_KEY" ]; then
|
|
||||||
php artisan key:generate --force --no-interaction || true
|
php artisan key:generate --force --no-interaction || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
php artisan storage:link || true
|
php artisan storage:link || true
|
||||||
|
|
||||||
# Run migrations only if enabled
|
|
||||||
if [ "${RUN_MIGRATIONS}" = "true" ]; then
|
if [ "${RUN_MIGRATIONS}" = "true" ]; then
|
||||||
echo "📦 Running migrations..."
|
|
||||||
php artisan migrate --force --no-interaction || true
|
php artisan migrate --force --no-interaction || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cache for production performance
|
|
||||||
php artisan config:cache || true
|
php artisan config:cache || true
|
||||||
php artisan route:cache || true
|
php artisan route:cache || true
|
||||||
php artisan view:cache || true
|
php artisan view:cache || true
|
||||||
|
|
||||||
echo "✅ Container ready."
|
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
root /var/www/html/public;
|
root /var/www/public;
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
|
|
||||||
client_max_body_size 20M;
|
client_max_body_size 20M;
|
||||||
@@ -14,8 +14,8 @@ server {
|
|||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass app:9000;
|
fastcgi_pass app:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME /var/www/public$fastcgi_script_name;
|
||||||
fastcgi_param DOCUMENT_ROOT /var/www/html/public;
|
fastcgi_param DOCUMENT_ROOT /var/www/public;
|
||||||
fastcgi_read_timeout 300;
|
fastcgi_read_timeout 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user