update compose
This commit is contained in:
parent
02b1991015
commit
ffc3b0c792
|
@ -1,6 +1,5 @@
|
|||
version: '3.9'
|
||||
name: demo01
|
||||
#Grafana官方提供模板地址:https://grafana.com/grafana/dashboards
|
||||
services:
|
||||
demo01:
|
||||
image: docker.io/library/demo01:1.0
|
||||
|
@ -12,8 +11,13 @@ services:
|
|||
- y9-share-net
|
||||
ports:
|
||||
- "7055:7055"
|
||||
#volumes:
|
||||
# - d:/docker-data/grafana:/var/lib/grafana
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.demo01.entrypoints=web"
|
||||
- "traefik.http.routers.demo01.rule=PathPrefix(`/demo01`)"
|
||||
#- "traefik.http.services.demo01.loadbalancer.server.scheme=http"
|
||||
#- "traefik.http.services.demo01.loadbalancer.server.port=7055"
|
||||
#- "traefik.docker.network=y9-share-net"
|
||||
|
||||
networks:
|
||||
y9-share-net:
|
||||
|
|
68
pom.xml
68
pom.xml
|
@ -104,4 +104,72 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Spring-Boot-Native-Processed>true</Spring-Boot-Native-Processed>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<image>
|
||||
<builder>paketobuildpacks/builder-jammy-tiny</builder>
|
||||
<buildpacks>
|
||||
<buildpack>gcr.io/paketo-buildpacks/graalvm</buildpack>
|
||||
<buildpack>
|
||||
gcr.io/paketo-buildpacks/java-native-image</buildpack>
|
||||
</buildpacks>
|
||||
<env>
|
||||
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
|
||||
<BP_JVM_VERSION>17.0.9</BP_JVM_VERSION>
|
||||
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>--enable-preview</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
|
||||
</env>
|
||||
</image>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>process-aot</id>
|
||||
<goals>
|
||||
<goal>process-aot</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<classesDirectory>
|
||||
${project.build.outputDirectory}</classesDirectory>
|
||||
<metadataRepository>
|
||||
<enabled>true</enabled>
|
||||
</metadataRepository>
|
||||
<requiredVersion>22.3</requiredVersion>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-reachability-metadata</id>
|
||||
<goals>
|
||||
<goal>add-reachability-metadata</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.risesoft.demo.entity.User;
|
|||
import net.risesoft.demo.repository.UserRepository;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/users")
|
||||
@RequestMapping
|
||||
public class UserController {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
@ -20,7 +20,7 @@ public class UserController {
|
|||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@GetMapping({"", "/", "/api/users"})
|
||||
public List<User> findAll(){
|
||||
return userRepository.findAll();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ spring:
|
|||
name: demo01
|
||||
cloud:
|
||||
consul:
|
||||
host: localhost
|
||||
host: host.docker.internal
|
||||
port: 8500
|
||||
discovery:
|
||||
register-health-check: true
|
||||
|
@ -44,7 +44,7 @@ spring:
|
|||
tags: test,y9
|
||||
datasource:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://host.docker.internal:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: '12345678'
|
||||
hikari:
|
||||
|
|
Loading…
Reference in New Issue