bowler/docker-compose.yml

70 lines
2.1 KiB
YAML

services:
app:
build:
context: ./docker/app
container_name: bowler-app
restart: unless-stopped
ports:
- "${APP_PORT:-8080}:80"
volumes:
- ./src:/var/www/html
environment:
APP_NAME: ${APP_NAME:-Bowler}
APP_ENV: ${APP_ENV:-production}
APP_KEY: ${APP_KEY}
APP_DEBUG: ${APP_DEBUG:-false}
APP_URL: ${APP_URL:-http://localhost:8080}
LOG_CHANNEL: stderr
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: "3306"
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SESSION_DRIVER: database
CACHE_STORE: database
QUEUE_CONNECTION: database
ADMIN_NAME: ${ADMIN_NAME}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
depends_on:
db:
condition: service_healthy
# Optional dev helper: rebuilds Tailwind CSS as views change.
# Start with: docker compose --profile dev up -d
tailwind:
build:
context: ./docker/app
container_name: bowler-tailwind
profiles: ["dev"]
working_dir: /var/www/html
volumes:
- ./src:/var/www/html
entrypoint: ["tailwindcss"]
command: ["-i", "resources/css/app.css", "-o", "public/css/app.css", "--watch=always"]
db:
image: percona:latest
container_name: bowler-db
restart: unless-stopped
# Tuned for a dev DB on a Windows bind mount: flush the redo log once per
# second instead of per commit (worst case ~1s of writes lost on a crash),
# skip reverse-DNS lookups, and give InnoDB a larger buffer pool.
command:
- --innodb-flush-log-at-trx-commit=2
- --innodb-buffer-pool-size=256M
- --skip-name-resolve
volumes:
- ./db-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
interval: 5s
timeout: 5s
retries: 30