101 lines
2.2 KiB
YAML
101 lines
2.2 KiB
YAML
name: reserva
|
|
|
|
x-app: &app
|
|
build:
|
|
context: .
|
|
env_file: .env
|
|
environment:
|
|
DB_HOST: postgres
|
|
DB_DATABASE: ${DOCKER_DB_DATABASE:-reserva}
|
|
DB_USERNAME: ${DOCKER_DB_USERNAME:-reserva}
|
|
DB_PASSWORD: ${DOCKER_DB_PASSWORD:-reserva}
|
|
REDIS_HOST: redis
|
|
CACHE_STORE: redis
|
|
QUEUE_CONNECTION: redis
|
|
MAIL_MAILER: smtp
|
|
MAIL_HOST: mailpit
|
|
MAIL_PORT: 1025
|
|
volumes:
|
|
- .:/var/www/html
|
|
- vendor:/var/www/html/vendor
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
services:
|
|
app:
|
|
<<: *app
|
|
|
|
nginx:
|
|
image: nginx:1.28-alpine
|
|
ports:
|
|
- "${APP_PORT:-8000}:80"
|
|
volumes:
|
|
- .:/var/www/html:ro
|
|
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
- app
|
|
restart: unless-stopped
|
|
|
|
node:
|
|
<<: *app
|
|
command: sh -lc "npm install && npm run dev -- --host 0.0.0.0"
|
|
ports:
|
|
- "${VITE_PORT:-5173}:5173"
|
|
volumes:
|
|
- .:/var/www/html
|
|
- vendor:/var/www/html/vendor
|
|
- node_modules:/var/www/html/node_modules
|
|
|
|
queue:
|
|
<<: *app
|
|
command: php artisan queue:work --tries=3 --timeout=90
|
|
|
|
scheduler:
|
|
<<: *app
|
|
command: php artisan schedule:work
|
|
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_DB: ${DOCKER_DB_DATABASE:-reserva}
|
|
POSTGRES_USER: ${DOCKER_DB_USERNAME:-reserva}
|
|
POSTGRES_PASSWORD: ${DOCKER_DB_PASSWORD:-reserva}
|
|
ports:
|
|
- "${FORWARD_DB_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DOCKER_DB_USERNAME:-reserva} -d ${DOCKER_DB_DATABASE:-reserva}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7.4-alpine
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
mailpit:
|
|
image: axllent/mailpit:v1.27
|
|
ports:
|
|
- "${MAILPIT_PORT:-8025}:8025"
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
node_modules:
|
|
vendor:
|