summaryrefslogtreecommitdiffstats
path: root/docker-compose
diff options
context:
space:
mode:
authorClaudio David Gasparini <claudio.gasparini@pantheon.tech>2020-11-08 22:18:36 +0100
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>2020-11-10 11:54:44 +0000
commit900ba02f458b3b7adc593f57d1e7447ce6cce142 (patch)
treec3b404b9237d918940a8d681ebbf92154bbe28bc /docker-compose
parent1bd1c6c8ad38d1df70f93c25f82321faa06ae8fc (diff)
Dockerize the service
- automatically generate docker image - provide docker-compose to start the service together with dockerized postgres db Issue-ID: CPS-22 Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech> Change-Id: I846d14e87de50bfb1411e0c9b49e9f6c6cc8ebda
Diffstat (limited to 'docker-compose')
-rw-r--r--docker-compose/README.md3
-rw-r--r--docker-compose/docker-compose.yml26
2 files changed, 29 insertions, 0 deletions
diff --git a/docker-compose/README.md b/docker-compose/README.md
new file mode 100644
index 0000000000..d23f033495
--- /dev/null
+++ b/docker-compose/README.md
@@ -0,0 +1,3 @@
+```bash
+VERSION=0.0.1-SNAPSHOT DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps docker-compose up
+``` \ No newline at end of file
diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml
new file mode 100644
index 0000000000..6894d3f2ca
--- /dev/null
+++ b/docker-compose/docker-compose.yml
@@ -0,0 +1,26 @@
+version: "3.7"
+
+services:
+ cps:
+ restart: unless-stopped
+ image: nexus3.onap.org:10001/onap/cps-service:${VERSION}
+ container_name: cps-service
+ environment:
+ DB_HOST: ${DB_HOST}
+ DB_USERNAME: ${DB_USERNAME}
+ DB_PASSWORD: ${DB_PASSWORD}
+ ports:
+ - "8080:8080"
+ network_mode: "host
+ depends_on:
+ - dbpostgresql
+
+ dbpostgresql:
+ container_name: dbpostgresql
+ image: postgres
+ ports:
+ - '5432:5432'
+ environment:
+ DB_NAME: cpsdb
+ DB_USERNAME: ${DB_USERNAME}
+ DB_PASSWORD: ${DB_PASSWORD} \ No newline at end of file