Browse Source

dockerfile

master
review512jwy@163.com 1 month ago
parent
commit
ddc033f861
  1. 20
      Dockerfile
  2. 32
      pom.xml
  3. 8
      src/main/resources/application-dev.properties
  4. 8
      src/main/resources/application-prd.properties
  5. 16
      src/main/resources/application.properties

20
Dockerfile

@ -0,0 +1,20 @@
# FROM registry.ap-northeast-1.aliyuncs.com/southwave/jdk17-template:latest
FROM amazoncorretto:17-alpine
# 安装 fontconfig 和 DejaVu 字体 (这是一个通用且免费的字体包)
RUN apk --no-cache upgrade && \
apk --no-cache add fontconfig ttf-dejavu
WORKDIR /app
COPY target/aeon-tcp.jar app.jar
EXPOSE 8200
# 使用UseCGroupMemoryLimitForHeap
# ENV JAVA_OPTS="-Xms5g -Xmx5g -XX:+UseParallelGC -XX:ParallelGCThreads=4 -XX:MaxGCPauseMillis=200 -XX:GCTimeRatio=19 -XX:NewRatio=3 -XX:+AlwaysPreTouch -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/app/gc.log"
# 使用shell方式的ENTRYPOINT来确保环境变量被展开
ENTRYPOINT java $JAVA_OPTS -jar app.jar -Djavax.net.debug=ssl --spring-profiles=$env

32
pom.xml

@ -28,6 +28,10 @@
</scm> </scm>
<properties> <properties>
<java.version>17</java.version> <java.version>17</java.version>
<aws.ecr.registry>126588786019.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registry>
<aws.ecr.registryTest>382934810846.dkr.ecr.ap-northeast-1.amazonaws.com</aws.ecr.registryTest>
<aws.ecr.repository>f10-tcp-gateway</aws.ecr.repository>
<aws.ecr.repositoryTest>f10-tcp-gateway-stg</aws.ecr.repositoryTest>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -81,25 +85,47 @@
</dependencies> </dependencies>
<build> <build>
<finalName>aeon-tcp</finalName>
<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>
</plugin> </plugin>
<!-- <plugin>-->
<!-- <groupId>io.fabric8</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <version>0.38.1</version>-->
<!-- <configuration>-->
<!-- <authConfig>-->
<!-- <username>AKIAR26KHSVRUEAKRBPZ</username>-->
<!-- <password>wmMPx9vypaNi5ZIlyz4c018hKCb2M1dnGBdA+oh2</password>-->
<!-- </authConfig>-->
<!-- <images>-->
<!-- <image>-->
<!-- <name>${aws.ecr.registry}/aeon-prod/${aws.ecr.repository}:latest</name>-->
<!-- <registry>${aws.ecr.registry}</registry>-->
<!-- <build>-->
<!-- <dockerFile>${project.basedir}/Dockerfile</dockerFile>-->
<!-- </build>-->
<!-- </image>-->
<!-- </images>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin> <plugin>
<groupId>io.fabric8</groupId> <groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId> <artifactId>docker-maven-plugin</artifactId>
<version>0.38.1</version> <version>0.38.1</version>
<configuration> <configuration>
<authConfig> <authConfig>
<username>AKIAQNYBBSGDVT3VF4ON</username> <username>AKIAVSKFRQDPNWHJDSHL</username>
<password>DEhPMTHAIsKK7L2klURQrmMe3r2Tqgbaa6z2FYQu</password> <password>DqGyOiVFKI50/Ix+cjvj25vPL2tC7NJrJ7fqzn/g</password>
</authConfig> </authConfig>
<images> <images>
<image> <image>
<name>${aws.ecr.registryTest}/aeon/${aws.ecr.repositoryTest}:latest</name> <name>${aws.ecr.registryTest}/aeon/${aws.ecr.repositoryTest}:latest</name>
<registry>${aws.ecr.registry}</registry> <registry>${aws.ecr.registryTest}</registry>
<build> <build>
<dockerFile>${project.basedir}/Dockerfile</dockerFile> <dockerFile>${project.basedir}/Dockerfile</dockerFile>
</build> </build>

8
src/main/resources/application-dev.properties

@ -0,0 +1,8 @@
gateway.tcp.port = 18084
spring.data.redis.host=r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com
spring.data.redis.port=6379
spring.data.redis.password=B2BGn4gK4htgkEwP
spring.data.redis.database=0
redis.stream.operation.batch-size=500

8
src/main/resources/application-prd.properties

@ -0,0 +1,8 @@
gateway.tcp.port = ${gatewayTcpPort}
spring.data.redis.host=${redisHost}
spring.data.redis.port=${redisPort}
spring.data.redis.password=${redisPassword}
spring.data.redis.database=${redisDatabase}
redis.stream.operation.batch-size=${redisStreamOperationBatchSize}

16
src/main/resources/application.properties

@ -1,11 +1,13 @@
spring.application.name=aeon_tcp spring.application.name=aeon_tcp
server.port=30004 server.port=30004
gateway.tcp.port = 18084 spring.profiles.active=${env:dev}
spring.data.redis.host=r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com #gateway.tcp.port = 18084
spring.data.redis.port=6379 #
spring.data.redis.password=B2BGn4gK4htgkEwP #spring.data.redis.host=r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com
spring.data.redis.database=0 #spring.data.redis.port=6379
#spring.data.redis.password=B2BGn4gK4htgkEwP
redis.stream.operation.batch-size=500 #spring.data.redis.database=0
#
#redis.stream.operation.batch-size=500
Loading…
Cancel
Save