version: '3.8' services: postgres: image: postgres:16-alpine container_name: linkding-postgres environment: - POSTGRES_DB=${DB_NAME:-linkding} - POSTGRES_USER=${DB_USER:-postgres} - POSTGRES_PASSWORD=${DB_PASSWORD:-postgres} volumes: - postgres-data:/var/lib/postgresql/data restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"] interval: 10s timeout: 3s retries: 5 linkding: build: . container_name: linkding image: wirelos/linkding:latest ports: - "3000:3000" volumes: - ./data:/app/data environment: - NODE_ENV=production - PORT=3000 - CHROME_EXECUTABLE_PATH=/usr/bin/chromium - DB_HOST=postgres - DB_PORT=5432 - DB_NAME=${DB_NAME:-linkding} - DB_USER=${DB_USER:-postgres} - DB_PASSWORD=${DB_PASSWORD:-postgres} depends_on: postgres: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/links', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"] interval: 30s timeout: 3s retries: 3 start_period: 5s volumes: postgres-data: