diff --git a/Jenkinsfile b/Jenkinsfile index 3a4a54e..d5d8311 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,6 @@ pipeline { environment { IMAGE_NAME = 'lpt-prod:0.0' CONTAINER_NAME = 'LPT-prod' - HOST_PORT = '5157' CONTAINER_PORT = '8888' } stages { @@ -30,13 +29,24 @@ pipeline { agent any steps { sh ''' + docker network create traefik-public || true docker rm -f $CONTAINER_NAME || true docker run -d --name $CONTAINER_NAME --network mysql-prod_mysql-prod \\ --restart=always \\ - -p $HOST_PORT:$CONTAINER_PORT -e SPRING_PROFILES_ACTIVE=prod \\ + -e SPRING_PROFILES_ACTIVE=prod \\ + --label "traefik.enable=true" \\ + --label "traefik.http.routers.lpt-api.rule=Host(`lpt.cat-shark.xyz`) && PathPrefix(`/api`)" \\ + --label "traefik.http.routers.lpt-api.entrypoints=websecure" \\ + --label "traefik.http.routers.lpt-api.tls.certresolver=le" \\ + --label "traefik.http.routers.lpt-api.priority=100" \\ + --label "traefik.http.routers.lpt-api.service=lpt-api" \\ + --label "traefik.http.routers.lpt-api.middlewares=lpt-api-strip" \\ + --label "traefik.http.middlewares.lpt-api-strip.stripprefix.prefixes=/api" \\ + --label "traefik.http.services.lpt-api.loadbalancer.server.port=$CONTAINER_PORT" \\ --log-driver=loki \\ --log-opt loki-url="http://192.168.123.199:3100/loki/api/v1/push" \\ $IMAGE_NAME + docker network connect traefik-public $CONTAINER_NAME || true ''' } } diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 2a45183..ae73a67 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -10,8 +10,6 @@ server: cors: allowed-origins: - - http://192.168.123.199:5158 - - http://39.105.149.197:8115 - https://lpt.cat-shark.xyz sa-token: