How do I confirm that Postgres is now the database? I followed the directions from Configuring Nexus Repository Pro for H2 or PostgreSQL for Postgres on my Docker deployment and I can’t confirm I am now using PostgreSQL. I edited the following two files in my Nexus container and restarted the containers.
/nexus-data/etc/nexus.properties
and
/nexus-data/etc/fabric/nexus-store.properties
Here is my docker-compose.yml
version: "3"
services:
# HTTPS proxy
nginx-proxy:
image: nginx:latest
container_name: nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
# Config
- /root/nexus3/default.conf:/etc/nginx/conf.d/default.conf
# Keep the dhparams (Should generate on the first run)
- dhparam:/etc/nginx/dhparam
# Fix the upload size issue
- /root/nexus3/my_custom_proxy_settings.conf:/etc/nginx/conf.d/my_custom_proxy_settings.conf:ro
# Push the certs to nginx
- /root/nexus3/certs:/etc/nginx/certs:ro
depends_on:
- nexus
# Artifact storage
nexus:
image: sonatype/nexus3:latest
container_name: nexus
restart: always
stop_grace_period: 2m
volumes:
- nexus-data:/nexus-data
- /mnt/nexus_mvn_mirror_repo_data:/nexus-mvn-mirror-repo-data
- /mnt/nexus_docker_repo_data:/nexus-docker-repo-data
- /mnt/nexus_mvn_repo_data:/nexus-mvn-repo-data
depends_on:
- postgres
# PostgreSQL Database
postgres:
image: postgres:latest
container_name: postgresql
restart: always
environment:
POSTGRES_USER: nexus3
POSTGRES_PASSWORD: REDACTED
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
nexus-data:
dhparam:
pgdata:
/nexus-data/etc/nexus.properties
# Jetty section
# application-port=8081
# application-host=0.0.0.0
# nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
# nexus-context-path=/${NEXUS_CONTEXT}
# Nexus section
# nexus-edition=nexus-pro-edition
# nexus-features=\
# nexus-pro-feature
# nexus.clustered=false
nexus.datastote.enabled=true
/nexus-data/etc/fabric/nexus-store.properties
username=nexus3
password=REDACTED
name=nexus
type=jdbc
jdbcUrl=jdbc\:postgresql\://postgres\:5432/nexus3