services: db: image: postgres:14 container_name: postgres # ports: # - 5433:5432 restart: unless-stopped volumes: - ./postgres:/var/lib/postgresql/data # Make database files persistent. Otherwise data is lost when the container is destroyed. environment: - APP_PORT=22300 # port joplin-server is reachable at - POSTGRES_PASSWORD=mypassword123 # database password - POSTGRES_USER=admin # database user - POSTGRES_DB=joplin # database name app: image: joplin/server:latest depends_on: - db ports: - "50002:22300" # Expose internal port to LAN restart: unless-stopped environment: - APP_BASE_URL=https://joplin.example.org - DB_CLIENT=pg - POSTGRES_PASSWORD=mypassword123 - POSTGRES_DATABASE=joplin - POSTGRES_USER=admin - POSTGRES_PORT=5432 - POSTGRES_HOST=db