Compare commits

..
20 Commits
Author SHA1 Message Date
Abdul Kareem 1ae07994cf Fix production Docker runtime for server deployment 2026-02-18 13:48:50 +03:00
Abdul Kareem dcbb0548e8 Refine Docker package dependencies
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 16:40:06 +03:00
Abdul Kareem 606eb53566 Update Docker dependencies and route formatting
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 16:12:59 +03:00
Abdul Kareem 0b8408dbfe Switch backend image to PHP Apache runtime 2026-02-17 15:57:01 +03:00
Abdul Kareem c4727b74ff Use php-fpm runtime and expose FPM port 2026-02-17 15:31:58 +03:00
Abdul Kareem 97775b8bef Fix PHP built-in server routing to Laravel index
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:59:55 +03:00
Abdul Kareem ddddfe4b9d Harden hosted DB env wiring and runtime bootstrap
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:56:00 +03:00
Abdul Kareem 9730598e68 Switch Docker runtime to php:8.3-cli with php -S on port 80
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:46:42 +03:00
Abdul Kareem d97f6b676b Run built-in PHP server on port 80
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:41:45 +03:00
Abdul Kareem 8b09f77bcb Use php-fpm as container command
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:38:12 +03:00
Abdul Kareem 158010b05c Remove php-fpm command override for hosted deployment 2026-02-17 00:20:51 +03:00
Abdul Kareem fc377b47a1 Fix PHP runtime libs for gd/intl/pdo_pgsql/zip in container
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:15:50 +03:00
Abdul Kareem 646fd8f8cf Set container default HTTP port to 80 for hosted runtime
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:09:35 +03:00
Abdul Kareem 60bbf14ec7 Fix deployment runtime to avoid 502 on hosted server
Deploy Backend / deploy (push) Has been cancelled
2026-02-17 00:06:51 +03:00
Abdul Kareem 2a7c74bceb Configure backend for PostgreSQL and fix auth password_hash mapping 2026-02-16 23:47:18 +03:00
Abdul Kareem 749b083a1f Migrate backend stack to PostgreSQL
Deploy Backend / deploy (push) Has been cancelled
2026-02-16 21:03:30 +03:00
Abdul Kareem 2d1886462a Fix Docker vendor install and add Gitea deploy workflow 2026-02-16 19:55:40 +03:00
Abdul Kareem b00626bd7a Merge remote main and keep backend README 2026-02-16 02:02:37 +03:00
Abdulkareem 86b9ba033b Initial commit 2026-02-15 23:00:42 +00:00
Abdul Kareem 34e152fd90 Initial backend upload 2026-02-16 01:57:33 +03:00
111 changed files with 109 additions and 50 deletions
+65
View File
@@ -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
View File
@@ -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"]
View File
View File
@@ -11,17 +11,9 @@ services:
APP_ENV: production
APP_DEBUG: "false"
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"
depends_on:
- db
volumes:
- storage_data:/var/www/html/storage
- storage_data:/var/www/storage
nginx:
image: nginx:1.27-alpine
@@ -32,7 +24,7 @@ services:
ports:
- "8000:80"
volumes:
- ./public:/var/www/html/public:ro
- ./public:/var/www/public:ro
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
db:
@@ -3,14 +3,11 @@ set -e
cd /var/www
echo "🚀 Starting Tabeley Production Container..."
# Create .env if not exists
if [ ! -f .env ]; then
cp .env.example .env
fi
# Function to safely update env values
# Update .env keys from runtime environment variables when provided.
set_env() {
key="$1"
value="$2"
@@ -23,38 +20,30 @@ set_env() {
fi
}
# Inject runtime environment variables
set_env DB_CONNECTION "${DB_CONNECTION}"
set_env DB_HOST "${DB_HOST}"
set_env DB_PORT "${DB_PORT}"
set_env DB_DATABASE "${DB_DATABASE}"
set_env DB_USERNAME "${DB_USERNAME}"
set_env DB_PASSWORD "${DB_PASSWORD}"
set_env DB_URL "${DB_URL}"
set_env DATABASE_URL "${DATABASE_URL}"
set_env APP_ENV "${APP_ENV}"
set_env APP_DEBUG "${APP_DEBUG}"
set_env APP_URL "${APP_URL}"
# Laravel setup
php artisan config:clear || true
if [ -z "$APP_KEY" ]; then
if ! grep -q "^APP_KEY=base64:" .env; then
php artisan key:generate --force --no-interaction || true
fi
php artisan storage:link || true
# Run migrations only if enabled
if [ "${RUN_MIGRATIONS}" = "true" ]; then
echo "📦 Running migrations..."
php artisan migrate --force --no-interaction || true
fi
# Cache for production performance
php artisan config:cache || true
php artisan route:cache || true
php artisan view:cache || true
echo "✅ Container ready."
exec "$@"
@@ -1,7 +1,7 @@
server {
listen 80;
server_name _;
root /var/www/html/public;
root /var/www/public;
index index.php index.html;
client_max_body_size 20M;
@@ -14,8 +14,8 @@ server {
include fastcgi_params;
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/html/public;
fastcgi_param SCRIPT_FILENAME /var/www/public$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/public;
fastcgi_read_timeout 300;
}
View File

Some files were not shown because too many files have changed in this diff Show More