Skip to content
Permalink
Browse files
docker-compose added
  • Loading branch information
fiammara committed Feb 28, 2020
1 parent 84507b3 commit ddc2a22c2ebd18b5e69fd40e60c51dbc8b888f7f
Showing 2 changed files with 55 additions and 1 deletion.
@@ -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

@@ -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:

0 comments on commit ddc2a22

Please sign in to comment.