version: '3'

services:
  db:
    image: postgres:15
    restart: always
    environment:
      POSTGRES_DB: wikijs
      POSTGRES_USER: wikijs
      POSTGRES_PASSWORD: wikijsrocks
    volumes:
      - ./data/db:/var/lib/postgresql/data

  wiki:
    image: ghcr.io/requarks/wiki:2
    restart: always
    ports:
      - "3000:3000"
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: wikijs
      DB_PASS: wikijsrocks
      DB_NAME: wikijs
    depends_on:
      - db
    volumes:
      - ./data/wiki:/wiki/data
