Skip to content

Added Dockerfile and Modified docker compose file for Employee application #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions employee-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use a Java 17 runtime (Debian-based, works on Apple Silicon)
FROM eclipse-temurin:17-jdk

# Set the working directory inside the container
WORKDIR /app

# Install Maven
RUN apt-get update && apt-get install -y maven

# Copy the current directory contents into the container at /app
COPY . /app/

# Build the binary
RUN mvn clean install -Dmaven.test.skip=true


# Expose the port your Spring Boot app runs on
EXPOSE 8080

# Run the application
ENTRYPOINT ["java", "-jar", "target/springbootapp-0.0.1-SNAPSHOT.jar"]
22 changes: 19 additions & 3 deletions employee-manager/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
version: '3.7'
services:
java-app:
build:
context: .
container_name: javaApp
depends_on:
- postgres
ports:
- "8080:8080"
networks:
- keploy-network
postgres:
image: postgres:latest
image: "postgres:15.2"
container_name: postgres
restart: always
environment:
- POSTGRES_DB=keploy-test
- POSTGRES_USER=keploy-user
- POSTGRES_PASSWORD=keploy
ports:
- '5432:5432'
networks:
- keploy-network
volumes:
# - ./postgres-data:/var/lib/postgresql/data
# copy the sql script to create tables
- ./src/main/resources/data.sql:/docker-entrypoint-datadb.d/data.sql
- ./src/main/resources/data.sql:/docker-entrypoint-datadb.d/data.sql

networks:
keploy-network:
external: true
9 changes: 7 additions & 2 deletions employee-manager/keploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ buildDelay: 30
test:
selectedTests: {}
globalNoise:
global: {}
test-sets: {}
#global: {
# "body":{
# "timestamp":"",
# }
#}

test-sets: {}
delay: 5
host: ""
port: 0
Expand Down
Loading
Loading