Add Coolify compose and env example

This commit is contained in:
alexandrump
2026-02-09 01:34:24 +01:00
parent 82f3464565
commit d26f8c943d
4 changed files with 70 additions and 0 deletions

12
.env.coolify.example Normal file
View File

@@ -0,0 +1,12 @@
# Coolify environment variables (example values)
POSTGRES_USER=gob
POSTGRES_PASSWORD=change-me-strong
POSTGRES_DB=gob_alert
# Internal Docker network connection
DATABASE_URL=postgres://gob:change-me-strong@postgres:5432/gob_alert
API_ADMIN_KEY=change-me-strong
# Web -> API internal URL (API is NOT public)
API_URL=http://api:3000

View File

@@ -24,6 +24,8 @@ docker compose build
docker compose up -d
```
Para Coolify en producción, usa `docker-compose.coolify.yml` y configura las variables en la UI.
Coolify: este `docker-compose.yml` incluye `api`, `web`, `postgres`, `redis` y `adminer` — Coolify puede usar las imágenes construidas aquí o construir directamente desde el contexto del repo.
Notas:
@@ -47,6 +49,8 @@ npm run dev
This will run `turbo run dev` and start both `api` and `web` in dev mode (if dependencies installed).
For Coolify production, use `docker-compose.coolify.yml` and configure variables in the UI.
See `PLAN.md` for project plan and MVP milestones.
Documentation:

View File

@@ -0,0 +1,45 @@
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
api:
build:
context: ./apps/api
environment:
DATABASE_URL: ${DATABASE_URL}
API_ADMIN_KEY: ${API_ADMIN_KEY}
NODE_ENV: production
depends_on:
- postgres
- redis
restart: unless-stopped
expose:
- "3000"
web:
build:
context: ./apps/web
environment:
API_URL: ${API_URL}
NODE_ENV: production
depends_on:
- api
restart: unless-stopped
expose:
- "3000"
volumes:
postgres_data:
redis_data:

View File

@@ -32,6 +32,15 @@ docker compose build
docker compose up -d
```
## Coolify (producción)
- Usa `docker-compose.coolify.yml` como compose principal.
- No publiques puertos de Postgres/Redis; deja que Coolify gestione el proxy.
- Define las variables en Coolify (Environment/Secrets). Hay un ejemplo en `.env.coolify.example`:
- `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`
- `DATABASE_URL` (ejemplo: `postgres://gob:***@postgres:5432/gob_alert`)
- `API_ADMIN_KEY`
- `API_URL` (ejemplo: `http://api:3000`)
## Estrategia recomendada (2 miniPCs)
1. **MiniPC 1**: ejecutar Postgres + Redis + jobs de ingesta.
2. **MiniPC 2**: ejecutar API + web + backups + alertas.