67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: stl-app
|
|
restart: unless-stopped
|
|
volumes:
|
|
- .:/app
|
|
ports:
|
|
- "${APP_PORT:-8080}:8000"
|
|
environment:
|
|
APP_ENV: local
|
|
APP_DEBUG: "true"
|
|
APP_URL: http://localhost:${APP_PORT:-8080}
|
|
DB_CONNECTION: mysql
|
|
DB_HOST: mysql
|
|
DB_PORT: 3306
|
|
DB_DATABASE: slots
|
|
DB_USERNAME: slots
|
|
DB_PASSWORD: slots
|
|
CACHE_STORE: redis
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
command: >
|
|
sh -c "
|
|
composer install --no-interaction &&
|
|
cp .env.example .env
|
|
php artisan migrate --force &&
|
|
php artisan db:seed --class=SlotSeeder --force &&
|
|
php artisan serve --host=0.0.0.0 --port=8000
|
|
"
|
|
|
|
mysql:
|
|
image: mysql:8.4
|
|
container_name: stl-mysql
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_DATABASE: slots
|
|
MYSQL_USER: slots
|
|
MYSQL_PASSWORD: slots
|
|
MYSQL_ROOT_PASSWORD: root
|
|
ports:
|
|
- "${MYSQL_PORT:-3306}:3306"
|
|
volumes:
|
|
- mysql_data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uslots", "-pslots"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: stl-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
|
|
volumes:
|
|
mysql_data:
|