Commit 363d00b0 authored by Vishal Vaddadhi's avatar Vishal Vaddadhi

added docker info

parent dd258213
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY employeeservice/build/libs/gradle-docker-sample-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
\ No newline at end of file
version: "3.9"
services:
db:
image: mysql
restart: always
environment:
MYSQL_USER: 'root'
MYSQL_DATABASE: 'sampleconnect'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '2348:3306'
web:
build: .
ports:
- "2367:8080"
\ No newline at end of file
......@@ -17,6 +17,10 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// implementation 'org.springframework.cloud:spring-cloud-starter-config'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
implementation 'junit:junit:4.12'
runtimeOnly 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
......@@ -28,6 +32,11 @@ test {
useJUnitPlatform()
}
jar {
archivesBaseName = 'gradle-docker-sample'
archiveVersion = '0.1.0'
}
tasks.register('simpletask') {
doLast {
String name = 'Vishal V'
......
......@@ -8,9 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.xml.ws.Response;
import java.util.List;
import java.util.Optional;
@CrossOrigin(origins = "*")
@RestController
......
......@@ -3,7 +3,7 @@ package com.nisum.employeeservice.model;
import javax.persistence.*;
@Entity
@Table(name = "employee")
@Table(name = "employeeinfo")
public class Employee {
@Id
......
spring.datasource.url=jdbc:h2:mem:dataSource
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.schema=classpath:employee.sql
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=none
spring.h2.console.enabled=true
#spring.data.mongodb.uri=mongodb+srv://userNisum:NisumCohort2021@cluster0.8ekps.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
#spring.data.mongodb.database=test
#server.port=9091
# JPA
spring.datasource.url=jdbc:mysql://db:2348/sampleconnect
spring.datasource.username=root
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect
spring.jpa.generate-ddl=false
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#spring.datasource.schema=classpath:studentaddress.sql
management.endpoint.beans.enabled=true
management.endpoints.web.exposure.include=*
DROP TABLE IF EXISTS EMPLOYEE;
CREATE TABLE EMPLOYEE (
ID INT AUTO_INCREMENT PRIMARY KEY,
FIRST_NAME VARCHAR (255) NOT NULL,
LAST_NAME VARCHAR (255) NOT NULL
);
INSERT INTO EMPLOYEE VALUES (1, 'John', 'Smith'), (2, 'Jane', 'Doe'), (3, 'Walter', 'Bell');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment