chore(docker): add .env.example, docs and helper to run on macOS
This commit is contained in:
parent
f14f15f2a2
commit
5d27068e06
28
.env.example
28
.env.example
@ -1,3 +1,31 @@
|
|||||||
|
# .env.example para ejecutar LibreTime con Docker Compose en macOS
|
||||||
|
# Copia este archivo a .env y modifica las contraseñas/valores antes de levantar el stack.
|
||||||
|
|
||||||
|
# Postgres
|
||||||
|
POSTGRES_HOST=postgres
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
POSTGRES_DB=libretime
|
||||||
|
POSTGRES_USER=libretime
|
||||||
|
POSTGRES_PASSWORD=change_me_postgres
|
||||||
|
|
||||||
|
# RabbitMQ
|
||||||
|
RABBITMQ_HOST=rabbitmq
|
||||||
|
RABBITMQ_PORT=5672
|
||||||
|
RABBITMQ_DEFAULT_VHOST=/libretime
|
||||||
|
RABBITMQ_DEFAULT_USER=libretime
|
||||||
|
RABBITMQ_DEFAULT_PASS=change_me_rabbit
|
||||||
|
|
||||||
|
# Icecast
|
||||||
|
ICECAST_SOURCE_PASSWORD=change_me_icecast
|
||||||
|
ICECAST_ADMIN_PASSWORD=change_me_icecast_admin
|
||||||
|
ICECAST_RELAY_PASSWORD=change_me_icecast_relay
|
||||||
|
ICECAST_ADMIN_USER=admin
|
||||||
|
ICECAST_HOSTNAME=localhost
|
||||||
|
|
||||||
|
# LibreTime
|
||||||
|
LIBRETIME_GENERAL_PUBLIC_URL=http://localhost:8000
|
||||||
|
LIBRETIME_DEBUG=true
|
||||||
|
LIBRETIME_VERSION=latest
|
||||||
POSTGRES_USER=libretime
|
POSTGRES_USER=libretime
|
||||||
POSTGRES_PASSWORD=libretime
|
POSTGRES_PASSWORD=libretime
|
||||||
POSTGRES_DB=libretime
|
POSTGRES_DB=libretime
|
||||||
|
|||||||
45
README.docker.md
Normal file
45
README.docker.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Ejecutar LibreTime en macOS con Docker Desktop
|
||||||
|
|
||||||
|
Pasos rápidos para desarrollo local usando Docker Desktop en macOS:
|
||||||
|
|
||||||
|
1. Instalar Docker Desktop (si no está instalado)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
brew install --cask docker
|
||||||
|
open --background -a Docker
|
||||||
|
# Espera a que Docker inicie (arriba a la derecha aparece el icono)
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Asignar recursos en Docker Desktop: al menos 2 CPUs y 4 GB RAM
|
||||||
|
|
||||||
|
3. Copiar `.env.example` a `.env` y editar contraseñas/variables
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
cp .env.example .env
|
||||||
|
# Edita .env y asigna contraseñas seguras para POSTGRES_PASSWORD y RABBITMQ_DEFAULT_PASS
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Levantar el stack (usando el compose preparado para EasyPanel que es env-driven):
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
docker compose -f docker-compose.easypanel.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Verificar estado y logs:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
docker compose -f docker-compose.easypanel.yml ps
|
||||||
|
docker compose -f docker-compose.easypanel.yml logs -f config-generator
|
||||||
|
docker compose -f docker-compose.easypanel.yml logs -f api
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Si necesitas entrar al contenedor para correr migraciones:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
docker compose -f docker-compose.easypanel.yml exec api python manage.py migrate --noinput
|
||||||
|
docker compose -f docker-compose.easypanel.yml exec api python manage.py createsuperuser
|
||||||
|
```
|
||||||
|
|
||||||
|
Notas específicas macOS:
|
||||||
|
- Usa volúmenes nombrados (ya configurado en el compose) para evitar I/O lento por bind mounts.
|
||||||
|
- Si el contenedor muestra errores relacionados con recursos, aumenta CPU/RAM en Docker Desktop.
|
||||||
19
scripts/docker-local-up.sh
Normal file
19
scripts/docker-local-up.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Helper para levantar LibreTime en macOS usando docker compose
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||||
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
|
if [ ! -f .env ]; then
|
||||||
|
echo ".env not found — copying from .env.example"
|
||||||
|
cp .env.example .env
|
||||||
|
echo "Please edit .env and set secure passwords for POSTGRES_PASSWORD and RABBITMQ_DEFAULT_PASS, then re-run this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting docker compose using docker-compose.easypanel.yml..."
|
||||||
|
docker compose -f docker-compose.easypanel.yml up -d
|
||||||
|
|
||||||
|
echo "Done. To see logs: docker compose -f docker-compose.easypanel.yml logs -f api"
|
||||||
Loading…
x
Reference in New Issue
Block a user