docker config done

This commit is contained in:
2024-09-28 23:42:55 +05:30
parent e206968993
commit f41a1043c9
6 changed files with 58 additions and 13 deletions

29
docker-compose.yml Normal file
View File

@ -0,0 +1,29 @@
# - DATABASE_HOST=mysql-common-mysql-1
services:
cmc-new-backend:
build:
context: ./support-portal-backend
dockerfile: Dockerfile
restart: always
ports:
- "8070:8080"
environment:
- DATABASE_HOST=mysql-common-mysql-1
networks:
- cmc-forntend
- mysql-common_mynetwork
# depends_on:
# db:
# condition: service_healthy
volumes:
db-data: {}
# secrets:
# db-password:
# file: db/password.txt
networks:
cmc-forntend: {}
mysql-common_mynetwork: {}

View File

@ -0,0 +1,15 @@
FROM --platform=$BUILDPLATFORM maven:3.8.5-eclipse-temurin-17 AS builder
WORKDIR /workdir/server
COPY pom.xml /workdir/server/pom.xml
RUN mvn dependency:go-offline
COPY src /workdir/server/src
RUN mvn package -Dmaven.test.skip=true
RUN ls -la target/
FROM eclipse-temurin:17-jre-focal
EXPOSE 8080
VOLUME /tmp
COPY --from=builder /workdir/server/target/*.jar /app/app.jar
ENTRYPOINT ["java","-jar","/app/app.jar"]

View File

@ -15,8 +15,11 @@
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<docker.image.prefix>artarkatesoft</docker.image.prefix> <docker.image.prefix>artarkatesoft</docker.image.prefix>
<docker.image.name>angular-${project.artifactId}</docker.image.name> <docker.image.name>angular-${project.artifactId}</docker.image.name>
@ -164,6 +167,12 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
@ -201,16 +210,7 @@
</path> </path>
</annotationProcessorPaths> </annotationProcessorPaths>
<compilerArgs>
<compilerArg>
<arg>-Amapstruct.defaultComponentModel=spring</arg>
<arg>-Amapstruct.verbose=true</arg>
</compilerArg>
</compilerArgs>
</configuration> </configuration>
</plugin> </plugin>

View File

@ -7,7 +7,7 @@ import org.mapstruct.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
import org.mapstruct.Named; import org.mapstruct.Named;
@Mapper( ) @Mapper(componentModel = "spring")
public interface ProfessorMapper { public interface ProfessorMapper {
// @Mapping(target = "professorId", ignore = true) // Auto-generated // @Mapping(target = "professorId", ignore = true) // Auto-generated

View File

@ -7,7 +7,7 @@ import org.mapstruct.Mapping;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Mapper(imports = {LocalDateTime.class}) @Mapper(componentModel = "spring",imports = {LocalDateTime.class})
public interface UserMapper { public interface UserMapper {
@Mapping(target = "isNotLocked", source = "notLocked") @Mapping(target = "isNotLocked", source = "notLocked")

View File

@ -24,6 +24,7 @@ spring:
enable: false enable: false
datasource: datasource:
url: jdbc:mysql://210.18.189.94:8098/demo url: jdbc:mysql://210.18.189.94:8098/demo
# url: jdbc:mysql://${MYSQL_HOST:db}:8098/demo
username: youruser username: youruser
password: youruserpassword password: youruserpassword
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver