Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eureka-server
Overview
Overview
Details
Activity
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
wangguangchao
eureka-server
Commits
35267860
Commit
35267860
authored
Nov 27, 2023
by
wangguangchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
简单方式
parent
73469306
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
124 deletions
+26
-124
Dockerfile
Dockerfile
+8
-21
eureka-server.iml
eureka-server.iml
+1
-3
k8sdeploy.yaml
k8sdeploy.yaml
+1
-2
pom.xml
pom.xml
+4
-98
application.properties
src/main/resources/application.properties
+12
-0
No files found.
Dockerfile
View file @
35267860
FROM
adoptopenjdk/openjdk8:x86_64-alpine-jdk8u382-b05
MAINTAINER
R&D(WH)@brilliance.com.cn
USER
root
ENV
WORKDIR=/workspace
RUN
sed
-i
's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g'
/etc/apk/repositories
\
&&
apk update
\
&&
apk add unzip
ADD
./target/*.zip ./app.zip
RUN
echo
"starting RUN command"
&&
\
unzip
-qo
app.zip
-d
$WORKDIR
&&
\
chmod
-R
772
$WORKDIR
&&
\
chmod 772
$WORKDIR
/config
&&
\
chmod 772
$WORKDIR
/bin
WORKDIR
/workspace
# 基于哪个镜像
From
java:8
# 复制文件到容器
ADD
./target/eureka-server-1.0-SNAPSHOT.jar /app.jar
# 声明需要暴露的端口
EXPOSE
8769
# 配置容器启动后执行的命令
ENTRYPOINT
java ${JAVA_OPTS} -jar /app.jar
\ No newline at end of file
eureka-server.iml
View file @
35267860
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<module
version=
"4"
>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
...
...
@@ -21,8 +21,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/profiles/local"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/profiles/dev"
type=
"java-resource"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
...
...
k8sdeploy.yaml
View file @
35267860
...
...
@@ -17,9 +17,8 @@ spec:
version
:
v1
spec
:
containers
:
-
image
:
rdwh/eurekaserver:latest
-
image
:
192.168.0.110:8062/
rdwh/eurekaserver:latest
name
:
eureka-server
command
:
[
'
sh'
,
'
-c'
,
'
sh
./bin/startup.sh
&&
sleep
3600'
]
ports
:
-
containerPort
:
8769
---
...
...
pom.xml
View file @
35267860
...
...
@@ -35,40 +35,6 @@
</dependency>
</dependencies>
<profiles>
<profile>
<id>
local
</id>
<activation>
<activeByDefault>
true
</activeByDefault>
</activation>
<properties>
<package.environment>
local
</package.environment>
<jar.version>
-SNAPSHOT
</jar.version>
</properties>
</profile>
<profile>
<id>
dev
</id>
<properties>
<package.environment>
dev
</package.environment>
<jar.version>
-SNAPSHOT
</jar.version>
</properties>
</profile>
<profile>
<id>
test
</id>
<properties>
<package.environment>
test
</package.environment>
<jar.version>
-TEST
</jar.version>
</properties>
</profile>
<profile>
<id>
prd
</id>
<properties>
<package.environment>
prd
</package.environment>
<jar.version>
-RELEASE
</jar.version>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>
brilliance-virtual
</id>
...
...
@@ -82,77 +48,17 @@
<build>
<plugins>
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <version>2.3.12.RELEASE</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>repackage</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<version>
3.1.1
</version>
<executions>
<execution>
<id>
copy-dependencies
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
3.1.1
</version>
<configuration>
<excludes>
<exclude>
*.**
</exclude>
<exclude>
*/*.xml
</exclude>
<exclude>
config/**
</exclude>
</excludes>
<archive>
<manifest>
<addClasspath>
true
</addClasspath>
<classpathPrefix>
lib/
</classpathPrefix>
<useUniqueVersions>
false
</useUniqueVersions>
<mainClass>
com.brilliance.hk.EurekaServerApplication
</mainClass>
</manifest>
</archive>
<outputDirectory>
${project.build.directory}
</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.1.1
</version>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.3.12.RELEASE
</version>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
singl
e
</goal>
<goal>
repackag
e
</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>
true
</attach>
<appendAssemblyId>
false
</appendAssemblyId>
<tarLongFileMode>
gnu
</tarLongFileMode>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
...
...
src/main/resources/application.properties
0 → 100644
View file @
35267860
# 给当前服务取一个名字
spring.application.name
=
eureka
# 设置端口号
server.port
=
8769
logging.config
=
classpath:logback.xml
# Eureka Server 也是一个普通的微服务,所以当它还是一个注册中心的时候,他会有两层身份:1.注册中心;2.普通服务。
# 默认情况下,会把自己注册到自己上面来,设置为 false 时,表示当前项目不要注册到注册中心上
eureka.client.register-with-eureka
=
false
# 表示是否从 Eureka Server 上获取注册信息
eureka.client.fetch-registry
=
false
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