Mejorando configuracion de stacks usando traefik
This commit is contained in:
63
stacks/moka/moka.env.example
Normal file
63
stacks/moka/moka.env.example
Normal file
@@ -0,0 +1,63 @@
|
||||
APP_NAME=Moka
|
||||
APP_ENV=production
|
||||
APP_KEY=secret
|
||||
APP_DEBUG=false
|
||||
APP_URL=https://moka.skrd.fun
|
||||
|
||||
APP_LOCALE=es
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
|
||||
HTTPS=on
|
||||
PHP_CLI_SERVER_WORKERS=4
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=pgsql
|
||||
DB_HOST=pgsql
|
||||
DB_PORT=5432
|
||||
DB_DATABASE=moka
|
||||
DB_USERNAME=moka
|
||||
DB_PASSWORD=secret
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
CACHE_STORE=database
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
OCTANE_SERVER=frankenphp
|
||||
|
||||
133
stacks/moka/moka.yml
Normal file
133
stacks/moka/moka.yml
Normal file
@@ -0,0 +1,133 @@
|
||||
services:
|
||||
moka:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=server
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=traefik"
|
||||
- "traefik.http.routers.moka.rule=Host(`moka.skrd.fun`)"
|
||||
- "traefik.http.routers.moka.entrypoints=websecure"
|
||||
- "traefik.http.routers.moka.tls.certresolver=cf"
|
||||
- "traefik.http.services.moka.loadbalancer.server.port=80"
|
||||
- "traefik.http.routers.moka.middlewares=redirect-to-https@file"
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
- proxy
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "curl -fsS http://localhost:80/up >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
|
||||
start_period: 20s
|
||||
|
||||
schedule:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=schedule
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "pgrep -f 'artisan schedule:work' >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
queue:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=queue
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pgrep -f 'artisan queue:work' >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli -h 127.0.0.1 ping | grep -q PONG"]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
|
||||
pgsql:
|
||||
image: "postgres:18"
|
||||
restart: unless-stopped
|
||||
shm_size: 128mb
|
||||
environment:
|
||||
PGPASSWORD: "${DB_PASSWORD:-secret}"
|
||||
POSTGRES_DB: "${DB_DATABASE}"
|
||||
POSTGRES_USER: "${DB_USERNAME}"
|
||||
POSTGRES_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -h 127.0.0.1 -p 5432 -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}",
|
||||
]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
internal:
|
||||
name: moka
|
||||
proxy:
|
||||
name: traefik
|
||||
external: true
|
||||
Reference in New Issue
Block a user