buckets/docker-compose.yml

107 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2025-12-29 17:16:42 +01:00
# 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:
2025-12-29 19:47:58 +01:00
- "8100:8000" # Laravel app
- "5174:5173" # Vite dev server
2025-12-29 17:16:42 +01:00
environment:
2025-12-29 19:47:58 +01:00
# Laravel
2025-12-29 17:16:42 +01:00
APP_NAME: "${APP_NAME:-buckets}"
APP_ENV: "${APP_ENV:-local}"
APP_KEY: "${APP_KEY:-base64:YOUR_KEY_HERE}"
APP_DEBUG: "${APP_DEBUG:-true}"
2025-12-29 19:47:58 +01:00
APP_URL: "${APP_URL:-http://localhost:8100}"
2025-12-29 17:16:42 +01:00
# 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}"
2025-12-29 19:47:58 +01:00
2025-12-29 17:16:42 +01:00
# Session & Cache
SESSION_DRIVER: "${SESSION_DRIVER:-file}"
CACHE_DRIVER: "${CACHE_DRIVER:-file}"
QUEUE_CONNECTION: "${QUEUE_CONNECTION:-sync}"
2025-12-29 19:47:58 +01:00
2025-12-29 17:16:42 +01:00
# Mail (for development)
MAIL_MAILER: "${MAIL_MAILER:-log}"
2025-12-29 19:47:58 +01:00
2025-12-29 17:16:42 +01:00
# Vite
VITE_HOST: "0.0.0.0"
2025-12-29 19:47:58 +01:00
VITE_PORT: "5174"
2025-12-29 17:16:42 +01:00
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
hostname: db
2025-12-29 17:16:42 +01:00
restart: unless-stopped
ports:
2025-12-29 19:47:58 +01:00
- "3307:3306"
2025-12-29 17:16:42 +01:00
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:
2025-12-29 19:47:58 +01:00
- "1026:1025" # SMTP server
- "8026:8025" # Web UI
2025-12-29 17:16:42 +01:00
networks:
- buckets
# 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:
2025-12-29 19:47:58 +01:00
app_node_modules: