Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
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
hubin
long-tern-care-service
Commits
a35d48b2
Commit
a35d48b2
authored
Feb 09, 2023
by
hubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限制容器大小和服务占用内存大小
parent
e7565284
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
15 deletions
+34
-15
Dockerfile
Dockerfile
+7
-7
Dockerfile1
Dockerfile1
+19
-0
run.sh
run.sh
+1
-1
start.sh
start.sh
+7
-7
No files found.
Dockerfile
View file @
a35d48b2
...
@@ -5,13 +5,13 @@ VOLUME /tmp
...
@@ -5,13 +5,13 @@ VOLUME /tmp
#容器使用端口
#容器使用端口
EXPOSE
8000
EXPOSE
8000
#添加jar包入容器
#添加jar包入容器
ADD
./
apply/apply-service/target
/apply-service-0.0.1.jar /apply.jar
ADD
./
jar
/apply-service-0.0.1.jar /apply.jar
ADD
./
assessment/assessment-service/target
/assessment-service-0.0.1.jar /assessment.jar
ADD
./
jar
/assessment-service-0.0.1.jar /assessment.jar
ADD
./
auth-service/target
/auth-0.0.1.jar /auth.jar
ADD
./
jar
/auth-0.0.1.jar /auth.jar
ADD
./
gateway-service/target
/gateway-0.0.1.jar /gateway.jar
ADD
./
jar
/gateway-0.0.1.jar /gateway.jar
ADD
./
governance/target
/governance-0.0.1.jar /governance.jar
ADD
./
jar
/governance-0.0.1.jar /governance.jar
ADD
./
system/system-admin-service/target
/system-admin-0.0.1.jar /system-admin.jar
ADD
./
jar
/system-admin-0.0.1.jar /system-admin.jar
ADD
./
account/account-service/target
/account-service-0.0.1.jar /account.jar
ADD
./
jar
/account-service-0.0.1.jar /account.jar
ADD
start.sh /start.sh
ADD
start.sh /start.sh
RUN
chmod
+x /start.sh
RUN
chmod
+x /start.sh
...
...
Dockerfile1
0 → 100644
View file @
a35d48b2
#指定依赖的镜像
FROM java:8
#springboot
VOLUME /tmp
#容器使用端口
EXPOSE 8000
#添加jar包入容器
ADD ./apply/apply-service/target/apply-service-0.0.1.jar /apply.jar
ADD ./assessment/assessment-service/target/assessment-service-0.0.1.jar /assessment.jar
ADD ./auth-service/target/auth-0.0.1.jar /auth.jar
ADD ./gateway-service/target/gateway-0.0.1.jar /gateway.jar
ADD ./governance/target/governance-0.0.1.jar /governance.jar
ADD ./system/system-admin-service/target/system-admin-0.0.1.jar /system-admin.jar
ADD ./account/account-service/target/account-service-0.0.1.jar /account.jar
ADD start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["sh","-c","./start.sh"]
run.sh
View file @
a35d48b2
...
@@ -8,4 +8,4 @@ docker stop ltc-poc
...
@@ -8,4 +8,4 @@ docker stop ltc-poc
docker
rm
ltc-poc
docker
rm
ltc-poc
docker rmi ltc:latest
docker rmi ltc:latest
docker build
-t
ltc
.
docker build
-t
ltc
.
docker run
-d
--name
ltc-poc
-p
9999:8001
-m
8
G ltc
docker run
-d
--name
ltc-poc
-p
9999:8001
-m
4
G ltc
start.sh
View file @
a35d48b2
#!/bin/bash
#!/bin/bash
mkdir
logs
mkdir
logs
nohup
java
-jar
/auth.jar
>
./logs/auth.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/auth.jar
>
./logs/auth.log &
nohup
java
-jar
/system-admin.jar
>
./logs/admin.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/system-admin.jar
>
./logs/admin.log &
nohup
java
-jar
/gateway.jar
>
./logs/gateway.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/gateway.jar
>
./logs/gateway.log &
nohup
java
-jar
/apply.jar
>
./logs/apply.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/apply.jar
>
./logs/apply.log &
nohup
java
-jar
/governance.jar
>
./logs/govwenanc.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/governance.jar
>
./logs/govwenanc.log &
nohup
java
-jar
/assessment.jar
>
./logs/assessment.log &
nohup
java
-Xms50m
-Xmx512m
-jar
/assessment.jar
>
./logs/assessment.log &
nohup
java
-jar
/account.jar
>
./logs/account.log &
while
[[
true
]]
;
do
while
[[
true
]]
;
do
...
@@ -14,3 +13,4 @@ while [[ true ]]; do
...
@@ -14,3 +13,4 @@ while [[ true ]]; do
sleep
1
sleep
1
done
done
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