119 lines
No EOL
3 KiB
YAML
119 lines
No EOL
3 KiB
YAML
# Local Development Docker Compose
|
|
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
container_name: buckets_app
|
|
restart: unless-stopped
|
|
# Remove user directive to run as root in container
|
|
# The container will handle permissions internally
|
|
ports:
|
|
- "8000:8000" # Laravel app
|
|
- "5173:5173" # Vite dev server
|
|
environment:
|
|
# Laravel
|
|
APP_NAME: "${APP_NAME:-buckets}"
|
|
APP_ENV: "${APP_ENV:-local}"
|
|
APP_KEY: "${APP_KEY:-base64:YOUR_KEY_HERE}"
|
|
APP_DEBUG: "${APP_DEBUG:-true}"
|
|
APP_URL: "${APP_URL:-http://localhost:8000}"
|
|
|
|
# Database
|
|
DB_CONNECTION: mysql
|
|
DB_HOST: db
|
|
DB_PORT: 3306
|
|
DB_DATABASE: "${DB_DATABASE:-buckets}"
|
|
DB_USERNAME: "${DB_USERNAME:-buckets}"
|
|
DB_PASSWORD: "${DB_PASSWORD:-buckets}"
|
|
|
|
# Session & Cache
|
|
SESSION_DRIVER: "${SESSION_DRIVER:-file}"
|
|
CACHE_DRIVER: "${CACHE_DRIVER:-file}"
|
|
QUEUE_CONNECTION: "${QUEUE_CONNECTION:-sync}"
|
|
|
|
# Mail (for development)
|
|
MAIL_MAILER: "${MAIL_MAILER:-log}"
|
|
|
|
# Vite
|
|
VITE_HOST: "0.0.0.0"
|
|
volumes:
|
|
# Mount entire project for hot reload with SELinux context
|
|
- .:/app:Z
|
|
# Named volumes for performance and permission isolation
|
|
- app_vendor:/app/vendor
|
|
- app_node_modules:/app/node_modules
|
|
depends_on:
|
|
- db
|
|
networks:
|
|
- buckets
|
|
|
|
db:
|
|
image: mariadb:11
|
|
container_name: buckets_db
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3306:3306"
|
|
environment:
|
|
MYSQL_DATABASE: "${DB_DATABASE:-buckets}"
|
|
MYSQL_USER: "${DB_USERNAME:-buckets}"
|
|
MYSQL_PASSWORD: "${DB_PASSWORD:-buckets}"
|
|
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:-root}"
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
# Initialize with SQL scripts
|
|
- ./docker/mysql-init:/docker-entrypoint-initdb.d
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
networks:
|
|
- buckets
|
|
|
|
# Optional: Mailhog for email testing
|
|
mailhog:
|
|
image: mailhog/mailhog
|
|
container_name: buckets_mailhog
|
|
restart: unless-stopped
|
|
ports:
|
|
- "1025:1025" # SMTP server
|
|
- "8025:8025" # Web UI
|
|
networks:
|
|
- buckets
|
|
|
|
# Selenium for E2E testing with Dusk
|
|
selenium:
|
|
image: selenium/standalone-chrome:latest
|
|
container_name: buckets_selenium
|
|
restart: unless-stopped
|
|
ports:
|
|
- "4444:4444" # Selenium server
|
|
- "7900:7900" # VNC server for debugging
|
|
volumes:
|
|
- /dev/shm:/dev/shm
|
|
networks:
|
|
- buckets
|
|
environment:
|
|
- SE_VNC_PASSWORD=secret
|
|
|
|
# Optional: Redis for caching/sessions
|
|
# redis:
|
|
# image: redis:alpine
|
|
# container_name: buckets_redis
|
|
# restart: unless-stopped
|
|
# ports:
|
|
# - "6379:6379"
|
|
# networks:
|
|
# - buckets
|
|
|
|
networks:
|
|
buckets:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
db_data:
|
|
app_vendor:
|
|
app_node_modules: |