You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2020/02/28 14:39:26 UTC

[juneau-petstore] branch master updated: docker-compose added

This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau-petstore.git


The following commit(s) were added to refs/heads/master by this push:
     new ddc2a22  docker-compose added
     new 3be1b9a  Merge pull request #11 from fiammara/master
ddc2a22 is described below

commit ddc2a22c2ebd18b5e69fd40e60c51dbc8b888f7f
Author: rasa <fi...@gmail.com>
AuthorDate: Fri Feb 28 10:59:01 2020 +0200

    docker-compose added
---
 Dockerfile         |  2 +-
 docker-compose.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 24bdd5e..d40cb0c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,7 @@ FROM maven:3.5-jdk-8 as build
 
 COPY . .
 
-RUN mvn clean package
+RUN mvn clean package -DskipTests
 
 FROM java:8
 
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..6d0904d
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,54 @@
+version: '2'
+
+# Define services
+services:
+  # backend service
+  app-server:
+    image: petstore
+    # Configuration for building the docker image for the backend service
+    build:
+      context: ./ # Use an image built from the specified dockerfile.
+      dockerfile: Dockerfile
+    ports:
+      - "5000:5000" # Forward the exposed port 5000 on the container to port 5000 on the host machine
+    restart: always
+    depends_on: 
+      - db 
+          
+    networks: # Networks to join 
+      - backend
+      - frontend
+
+  # frontend service 
+  app-client:
+    build:
+      context: pets # Use an image built from the specified dockerfile.
+      dockerfile: Dockerfile
+      args:
+        REACT_APP_API_BASE_URL: localhost:3000
+    ports:
+      - "3000:3000" # Map the exposed port 3000 on the container to port 3000 on the host machine
+    restart: always
+    depends_on:
+      - app-server
+    networks:
+      - frontend  
+
+  # Database Service (Apache Derby)
+  db:
+    image: az82/docker-derby
+    ports:
+          - "1527:1527"
+    restart: always
+    
+    networks:
+      - backend  
+  
+# Volumes
+volumes:
+  db-data:
+
+# Networks to be created to facilitate communication between containers
+networks:
+  backend:
+  frontend: