Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SpringBootBasicsAssignment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vishal Vaddadhi
SpringBootBasicsAssignment
Commits
363d00b0
Commit
363d00b0
authored
Apr 21, 2021
by
Vishal Vaddadhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added docker info
parent
dd258213
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
23 deletions
+44
-23
Dockerfile
Dockerfile
+4
-0
docker-compose.yml
docker-compose.yml
+16
-0
build.gradle
employeeservice/build.gradle
+9
-0
EmployeeController.java
.../nisum/employeeservice/controller/EmployeeController.java
+2
-2
Employee.java
...c/main/java/com/nisum/employeeservice/model/Employee.java
+1
-1
application.properties
employeeservice/src/main/resources/application.properties
+12
-10
employee.sql
employeeservice/src/main/resources/employee.sql
+0
-10
No files found.
Dockerfile
0 → 100644
View file @
363d00b0
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
docker-compose.yml
0 → 100644
View file @
363d00b0
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
employeeservice/build.gradle
View file @
363d00b0
...
...
@@ -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'
...
...
employeeservice/src/main/java/com/nisum/employeeservice/controller/EmployeeController.java
View file @
363d00b0
...
...
@@ -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
...
...
employeeservice/src/main/java/com/nisum/employeeservice/model/Employee.java
View file @
363d00b0
...
...
@@ -3,7 +3,7 @@ package com.nisum.employeeservice.model;
import
javax.persistence.*
;
@Entity
@Table
(
name
=
"employee"
)
@Table
(
name
=
"employee
info
"
)
public
class
Employee
{
@Id
...
...
employeeservice/src/main/resources/application.properties
View file @
363d00b0
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
=
*
employeeservice/src/main/resources/employee.sql
deleted
100644 → 0
View file @
dd258213
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment