mirror of
https://github.com/polaroi8d/cactoide.git
synced 2026-03-22 14:15:28 +00:00
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Database
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: cactoide-db
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-cactoied_database}
|
|
POSTGRES_USER: ${POSTGRES_USER:-cactoide}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cactoide_password}
|
|
ports:
|
|
- '${POSTGRES_PORT:-5432}:5432'
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
healthcheck:
|
|
test:
|
|
[
|
|
'CMD-SHELL',
|
|
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoied_database}'
|
|
]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- cactoide-network
|
|
|
|
# Application
|
|
app:
|
|
image: ghcr.io/polaroi8d/cactoide/cactoide:${APP_VERSION:-latest}
|
|
container_name: cactoide-app
|
|
ports:
|
|
- '${PORT:-3000}:3000'
|
|
environment:
|
|
DATABASE_URL: postgres://${POSTGRES_USER:-cactoide}:${POSTGRES_PASSWORD:-cactoide_password}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-cactoied_database}
|
|
PORT: 3000
|
|
HOSTNAME: ${HOSTNAME:-0.0.0.0}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- cactoide-network
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
cactoide-network:
|
|
driver: bridge
|