κρμγ 4 年之前
父節點
當前提交
8556e81e28

+ 1 - 1
.drone.yml

@@ -31,4 +31,4 @@ pipeline:
       - docker network create --subnet 172.19.0.0/24  --driver bridge frei-network || true
       - docker build -t frei/frei-backend:b${DRONE_BUILD_NUMBER} .
       - docker rm -f frei_backend || true
-      - docker run -d --name frei_backend --ip 172.19.0.11 --network frei-network --env SPRING_PROFILES_ACTIVE=production --env MONGO_PASSWORD=$MONGO_PASSWORD --env "VIRTUAL_HOST=freigeld.in" --env "LETSENCRYPT_HOST=freigeld.in" --restart always frei/frei-backend:b${DRONE_BUILD_NUMBER}
+      - docker run -d --name frei_backend --ip 172.19.0.11 --network frei-network --env SPRING_PROFILES_ACTIVE=production --env MONGO_PASSWORD=$MONGO_PASSWORD --env "VIRTUAL_HOST=freigeld.online" --env "LETSENCRYPT_HOST=freigeld.online" --restart always frei/frei-backend:b${DRONE_BUILD_NUMBER}

+ 2 - 1
src/main/kotlin/inn/ocsf/bee/freigeld/FreiApp.kt

@@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication
 import org.springframework.boot.autoconfigure.SpringBootApplication
 import org.springframework.context.annotation.Profile
 import org.springframework.context.annotation.PropertySource
+import org.springframework.context.annotation.PropertySources
 import org.springframework.scheduling.annotation.EnableScheduling
 import org.springframework.stereotype.Service
 import org.springframework.web.bind.annotation.RequestMapping
@@ -15,7 +16,7 @@ import javax.inject.Inject
 
 @SpringBootApplication
 @EnableScheduling
-@PropertySource("classpath:application.yaml")
+@PropertySources(value = [PropertySource("classpath:application-default.yaml")])
 class FreiApp{
 
     @PostConstruct

+ 9 - 0
src/main/resources/application-default.yaml

@@ -0,0 +1,9 @@
+server:
+  servlet:
+    context-path: /
+spring:
+  data:
+    mongodb:
+      username: frei_backend
+      database: frei
+      authentication-database: frei

+ 2 - 2
src/main/resources/application-production.yaml

@@ -3,5 +3,5 @@ server:
 spring:
   data:
     mongodb:
-      uri: mongodb://77.244.213.167:27017/frei?replicaSet=frei0
-      password: xxx
+      host: 77.244.213.167
+      port: 27017

+ 0 - 7
src/main/resources/application.yaml

@@ -1,7 +0,0 @@
-server:
-  servlet:
-    context-path: /
-spring:
-  data:
-    mongodb:
-      username: frei_backend