This commit is contained in:
Administrator
2024-05-10 10:32:59 +08:00
parent 632aadfe4d
commit 491f304a04
4 changed files with 35 additions and 10 deletions

View File

@@ -8,10 +8,10 @@ build:
stage: build
script:
- mvn clean package
- docker build -t library ./library
- docker build -t gateway ./gateway
- sudo docker build -t library ./library
- sudo docker build -t gateway ./gateway
deploy:
stage: deploy
script:
- docker-compose up -d
- sudo docker-compose up -d

View File

@@ -17,17 +17,32 @@ services:
image: nacos/nacos-server:2.0.2
networks:
- mynetwork
environment:
MODE: "standalone"
library:
image: library
image: openjdk:8-jdk-alpine
volumes:
- ./library/target/library-0.0.1-SNAPSHOT.jar:/app/library-0.0.1-SNAPSHOT.jar
environment:
MYSQL_HOST: mysql
REDIS_HOST: redis
NACOS_HOST: nacos
networks:
- mynetwork
ports:
- 9200:8080
depends_on:
- nacos
- mysql
- redis
command:
- java -jar /app/library-0.0.1-SNAPSHOT.jar
gateway:
image: gateway
image: openjdk:8-jdk-alpine
environment:
MYSQL_HOST: mysql
REDIS_HOST: redis
@@ -35,6 +50,16 @@ services:
networks:
- mynetwork
ports:
- 9000:9000
- 9100:8080
depends_on:
- nacos
- mysql
- redis
volumes:
- ./gateway/target/gateway-1.0-SNAPSHOT.jar:/app/gateway-1.0-SNAPSHOT.jar
command:
- java -jar /app/gateway-1.0-SNAPSHOT.jar
networks:
mynetwork:

View File

@@ -1,5 +1,5 @@
server:
port: 9000
port: 8080
spring:
application:
@@ -11,7 +11,7 @@ spring:
gateway:
routes:
- id: demo-one
uri: lb://libirary-service
uri: lb://library-service
predicates:
- Path=/**
# predicates:

View File

@@ -1,5 +1,5 @@
server:
port: 9090
port: 8080
spring:
datasource:
@@ -10,7 +10,7 @@ spring:
application:
name: libirary-service
name: library-service
cloud:
nacos: