使用 PostgreSQL 的 Sonatype Nexus docker-compose 设置

docker-compose-nexus.yml
services:
  postgres:
    image: postgres
    restart: unless-stopped
    volumes:
      - ./pg_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=${POSTGRES_DB}
      - POSTGRES_USER=${POSTGRES_USER}
  nexus:
    image: sonatype/nexus3:3.70.0
    restart: unless-stopped
    depends_on:
      - postgres
    volumes:
      - "./nexus_data:/nexus-data"
      - "./nexus_logs2:/logs"
      - "./nexus_logs:/opt/sonatype/logs"
    labels:
      - "traefik.enable=true"
      # Nexus (main webinterface)
      - "traefik.http.routers.nexus-techoverflow.rule=Host(`nexus.techoverflow.net`)"
      - "traefik.http.routers.nexus-techoverflow.entrypoints=websecure"
      - "traefik.http.routers.nexus-techoverflow.tls.certresolver=cloudflare-ec384"
      - "traefik.http.routers.nexus-techoverflow.tls.domains[0].main=techoverflow.net"
      - "traefik.http.routers.nexus-techoverflow.tls.domains[0].sans=*.techoverflow.net"
      - "traefik.http.services.nexus-techoverflow.loadbalancer.server.port=8081"
      - "traefik.http.routers.nexus-techoverflow.service=nexus-techoverflow"
      - "traefik.http.middlewares.nexus-techoverflow-compress.compress=true"
      - "traefik.http.routers.nexus-techoverflow.middlewares=nexus-techoverflow-compress"
      # Docker registry (runs on separate port 8089 and needs to be configured in Nexus first
      - "traefik.http.routers.registry-techoverflow.rule=Host(`registry.techoverflow.net`)"
      - "traefik.http.routers.registry-techoverflow.entrypoints=websecure"
      - "traefik.http.routers.registry-techoverflow.tls.certresolver=cloudflare-ec384"
      - "traefik.http.routers.registry-techoverflow.tls.domains[0].main=techoverflow.net"
      - "traefik.http.routers.registry-techoverflow.tls.domains[0].sans=*.techoverflow.net"
      - "traefik.http.services.registry-techoverflow.loadbalancer.server.port=8089"
      - "traefik.http.routers.registry-techoverflow.service=registry-techoverflow"
      - "traefik.http.middlewares.registry-techoverflow-compress.compress=true"
      - "traefik.http.routers.registry-techoverflow.middlewares=nexus-techoverflow-compress"

Check out similar posts by category: Docker