chore: refactor Docker environment and production configuration for improved deployment support
This commit is contained in:
+29
-11
@@ -1,42 +1,60 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "${HOST_PORT:-8000}:8000"
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
SERVICE_URL_APP_80: "${SERVICE_URL_APP_80:-}"
|
||||
APP_NAME: "${APP_NAME:-WebGIS SPBU}"
|
||||
APP_ENV: "${APP_ENV:-production}"
|
||||
APP_DEBUG: "${APP_DEBUG:-false}"
|
||||
APP_URL: "${APP_URL:-http://localhost:8000}"
|
||||
APP_KEY: "${APP_KEY:-}"
|
||||
APP_KEY: "${APP_KEY:?Set APP_KEY in Coolify. Generate one with: php artisan key:generate --show}"
|
||||
LOG_CHANNEL: "${LOG_CHANNEL:-stack}"
|
||||
LOG_STACK: "${LOG_STACK:-single}"
|
||||
LOG_LEVEL: "${LOG_LEVEL:-warning}"
|
||||
DB_CONNECTION: mysql
|
||||
DB_HOST: "${DB_HOST:-db}"
|
||||
DB_PORT: "${DB_PORT:-3306}"
|
||||
DB_DATABASE: "${DB_DATABASE:-spbu_baru}"
|
||||
DB_USERNAME: "${DB_USERNAME:-spbu}"
|
||||
DB_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||
SESSION_DRIVER: "${SESSION_DRIVER:-file}"
|
||||
CACHE_STORE: "${CACHE_STORE:-file}"
|
||||
DB_PASSWORD: "${DB_PASSWORD:-${SERVICE_PASSWORD_64_MYSQL:-spbu_local_db_password}}"
|
||||
SESSION_DRIVER: "${SESSION_DRIVER:-database}"
|
||||
CACHE_STORE: "${CACHE_STORE:-database}"
|
||||
QUEUE_CONNECTION: "${QUEUE_CONNECTION:-sync}"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/ >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- mysqld
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
environment:
|
||||
MYSQL_DATABASE: "${DB_DATABASE:-spbu_baru}"
|
||||
MYSQL_USER: "${DB_USERNAME:-spbu}"
|
||||
MYSQL_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:-rootsecret}"
|
||||
MYSQL_PASSWORD: "${DB_PASSWORD:-${SERVICE_PASSWORD_64_MYSQL:-spbu_local_db_password}}"
|
||||
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:-${SERVICE_PASSWORD_64_MYSQL_ROOT:-spbu_local_root_password}}"
|
||||
volumes:
|
||||
- spbu-mysql-data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${DB_ROOT_PASSWORD:-rootsecret}"]
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -p\"$${MYSQL_ROOT_PASSWORD}\" --silent"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
spbu-mysql-data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user