11version : ' 3.9'
22
3- x-env-license : &env-license-volume '${NEXUS_LICENSE_PATH:?err}:/sonatype-license.lic'
3+ x-env-license : &env-license-volume '${NEXUS_LICENSE_PATH:?err}:/sonatype-license.lic:ro '
44
55x-nxrm3-healthcheck : &nxrm3-healthcheck
66 test :
@@ -16,15 +16,21 @@ x-nxrm3-healthcheck: &nxrm3-healthcheck
1616 retries : 10
1717 start_period : 40s
1818
19+ x-nxiq-volume-data : &x-nxiq-volume-data 'nxiq-data:/sonatype-work'
20+
21+ x-nxiq-volume-logs : &x-nxiq-volume-logs 'nxiq-logs:/var/log/nexus-iq-server'
22+
1923x-nxrm3-volume-nexus-properties : &nxrm3-volume-nexus-properties './config/nexus-repo.properties:/nexus-data/etc/nexus.properties'
2024
2125x-nxrm3-volume-casc-config : &nxrm3-volume-casc-config './config/nexus-repo-casc.yaml:/opt/nexus.yml:ro'
2226
2327x-nxrm3-volume-casc-config-oss : &nxrm3-volume-casc-config-oss './config/nexus-repo-casc-oss.yaml:/opt/nexus.yml:ro'
2428
25- x-nxrm3-volume-data : &nxrm3-volume-data '${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/nexus-data:/nexus-data:delegated'
29+ x-nxrm3-volume-data : &nxrm3-volume-data 'nxrm-data:/opt/sonatype/sonatype-work'
30+
31+ x-pgsql-volume-data : &pgsql-volume-data 'pg-data:/var/lib/postgresql/data'
2632
27- x-pgsql-volume-data : &pgsql-volume-data '${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/pgdata:/ var/lib/postgresql/data/pgdata:delegated '
33+ x-pgsql-nxrm- volume-data : &pgsql-nxrm- volume-data 'pg-nxrm-data:/ var/lib/postgresql/data'
2834
2935
3036secrets :
@@ -33,8 +39,11 @@ secrets:
3339
3440services :
3541
36- nxiq_direct :
42+ nxiq-direct :
3743 image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus-iq-server:${NEXUS_IQ_SERVER_VERSION:?err}"
44+ depends_on :
45+ postgres :
46+ condition : service_healthy
3847 environment :
3948 JAVA_OPTS : " -Ddw.baseUrl=${NXLC_FQDN_URL:-http://iq.localhost:8070} -Djava.util.prefs.userRoot=/sonatype-work/javaprefs"
4049 DATABASE_TYPE : postgresql
@@ -53,14 +62,14 @@ services:
5362 volumes :
5463 - *env-license-volume
5564 - " ./config/nexus-iq-config.yaml:/etc/nexus-iq-server/config.yml:delegated"
56- - " ${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/iq-data:/sonatype-work:delegated"
57- - " ${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/iq-logs:/opt/sonatype/nexus-iq-server/log:delegated"
65+ - *x-nxiq-volume-data
66+ - *x-nxiq-volume-logs
67+
68+ nxiq-proxied :
69+ image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus-iq-server:${NEXUS_IQ_SERVER_VERSION:?err}"
5870 depends_on :
5971 postgres :
6072 condition : service_healthy
61-
62- nxiq-proxied :
63- image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus-iq-server:${NEXUS_IQ_SERVER_VERSION:?err}"
6473 environment :
6574 JAVA_OPTS : " -Ddw.baseUrl=${NXLC_FQDN_URL:-http://iq.localhost} -Djava.util.prefs.userRoot=/sonatype-work/javaprefs"
6675 DATABASE_TYPE : postgresql
@@ -80,18 +89,19 @@ services:
8089 volumes :
8190 - *env-license-volume
8291 - " ./config/nexus-iq-config.yaml:/etc/nexus-iq-server/config.yml:delegated"
83- - " ${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/iq-data:/sonatype-work:delegated"
84- - " ${DOCKER_ROOT_VOLUME_MOUNT_POINT:?err}/iq-logs:/opt/sonatype/nexus-iq-server/log:delegated"
85- depends_on :
86- postgres :
87- condition : service_healthy
92+ - *x-nxiq-volume-data
93+ - *x-nxiq-volume-logs
8894
89- nxrm3_direct :
95+ nxrm3-direct :
9096 image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus3:${NEXUS_REPOSITORY_VERSION:?err}"
97+ depends_on :
98+ postgres-nxrm :
99+ condition : service_healthy
91100 environment :
92101 BASE_URL : " ${NXRM_FQDN_URL:-http://repo.localhost:8081}"
102+ DATABASE_PASSWORD : ${PG_DB_PASS:?err}
103+ INSTALL4J_ADD_VM_PARAMS : " -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Dnexus.licenseFile=/sonatype-license.lic -Dnexus.datastore.enabled=true -Djava.util.prefs.userRoot=$${NEXUS_DATA}/javaprefs -Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://postgres-nxrm:5432/nxrm -Dnexus.datastore.nexus.username=nxrm -Dnexus.datastore.nexus.password=$${DATABASE_PASSWORD} -Dnexus.datastore.clustered.enabled=true"
93104 NEXUS_SECURITY_RANDOMPASSWORD : ' false'
94- NEXUS_CASC_CONFIG : ' /opt/nexus.yml'
95105 NEXUS_IQ_BASE_URL : " ${NXLC_FQDN_URL:-http://iq.localhost:8070}"
96106 healthcheck :
97107 << : *nxrm3-healthcheck
@@ -104,17 +114,9 @@ services:
104114 - admin_password
105115 volumes :
106116 - *env-license-volume
107- - *nxrm3-volume-nexus-properties
108- - *nxrm3-volume-casc-config
109- - *nxrm3-volume-data
110117
111118 nxrm3_direct_oss :
112- build :
113- context : ./images/nxrm3
114- args :
115- NEXUS_DOCKER_IMAGE_ORGANIZATION : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}"
116- NEXUS_REPOSITORY_VERSION : " ${NEXUS_REPOSITORY_VERSION}"
117- NEXUS_CASC_PLUGIN_VERSION : " ${NEXUS_CASC_PLUGIN_VERSION}"
119+ image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus3:${NEXUS_REPOSITORY_VERSION:?err}"
118120 environment :
119121 BASE_URL : ' http://repo.localhost:8081'
120122 NEXUS_SECURITY_RANDOMPASSWORD : ' false'
@@ -128,22 +130,21 @@ services:
128130 - repoOssDemo
129131 secrets :
130132 - admin_password
131- volumes :
132- - *nxrm3-volume-nexus-properties
133- - *nxrm3-volume-casc-config-oss
134- - *nxrm3-volume-data
133+ # volumes:
134+ # - *nxrm3-volume-nexus-properties
135+ # - *nxrm3-volume-casc-config-oss
136+ # - *nxrm3-volume-data
135137
136138 nxrm3-proxied :
137- build :
138- context : ./images/nxrm3
139- args :
140- NEXUS_DOCKER_IMAGE_ORGANIZATION : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}"
141- NEXUS_REPOSITORY_VERSION : " ${NEXUS_REPOSITORY_VERSION}"
142- NEXUS_CASC_PLUGIN_VERSION : " ${NEXUS_CASC_PLUGIN_VERSION}"
139+ image : " ${NEXUS_DOCKER_IMAGE_ORGANIZATION}/nexus3:${NEXUS_REPOSITORY_VERSION:?err}"
140+ depends_on :
141+ postgres-nxrm :
142+ condition : service_healthy
143143 environment :
144- BASE_URL : " ${NXRM_FQDN_URL:-http://repo.localhost}"
144+ BASE_URL : " ${NXRM_FQDN_URL:-http://repo.localhost}"
145+ DATABASE_PASSWORD : ${PG_DB_PASS:?err}
146+ INSTALL4J_ADD_VM_PARAMS : " -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Dnexus.licenseFile=/sonatype-license.lic -Dnexus.datastore.enabled=true -Djava.util.prefs.userRoot=$${NEXUS_DATA}/javaprefs -Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://postgres-nxrm:5432/nxrm -Dnexus.datastore.nexus.username=nxrm -Dnexus.datastore.nexus.password=$${DATABASE_PASSWORD} -Dnexus.datastore.clustered.enabled=true"
145147 NEXUS_SECURITY_RANDOMPASSWORD : ' false'
146- NEXUS_CASC_CONFIG : ' /opt/nexus.yml'
147148 NEXUS_IQ_BASE_URL : " ${NXLC_FQDN_URL:-http://iq.localhost}"
148149 healthcheck :
149150 << : *nxrm3-healthcheck
@@ -159,9 +160,6 @@ services:
159160 - admin_password
160161 volumes :
161162 - *env-license-volume
162- - *nxrm3-volume-nexus-properties
163- - *nxrm3-volume-casc-config
164- - *nxrm3-volume-data
165163
166164 postgres :
167165 image : " postgres:16.0-alpine3.18"
@@ -175,6 +173,7 @@ services:
175173 - platform
176174 ports :
177175 - ' 5432:5432'
176+ shm_size : 128mb
178177 user : ' ${UID}:${GID}'
179178 volumes :
180179 - *pgsql-volume-data
@@ -184,6 +183,28 @@ services:
184183 timeout : 5s
185184 retries : 10
186185
186+ postgres-nxrm :
187+ image : " postgres:16.0-alpine3.18"
188+ environment :
189+ - POSTGRES_USER=nxrm
190+ - POSTGRES_PASSWORD=${PG_DB_PASS:?err}
191+ - POSTGRES_DB=nxrm
192+ - PGDATA=/var/lib/postgresql/data/pgdata
193+ networks :
194+ - default
195+ - platform
196+ ports :
197+ - ' 5433:5432'
198+ shm_size : 128mb
199+ user : ' ${UID}:${GID}'
200+ volumes :
201+ - *pgsql-nxrm-volume-data
202+ healthcheck :
203+ test : ["CMD-SHELL", "pg_isready -U nxrm"]
204+ interval : 1s
205+ timeout : 5s
206+ retries : 10
207+
187208 proxy :
188209 image : " nginx:${NGINX_VERSION:?err}"
189210 depends_on :
@@ -397,3 +418,10 @@ networks:
397418 default : null
398419 platform : null
399420 teamcity : null
421+
422+ volumes :
423+ nxiq-data :
424+ nxiq-logs :
425+ nxrm-data :
426+ pg-data :
427+ pg-nxrm-data:
0 commit comments