Skip to content

Commit

Permalink
Merge pull request #238 from opensourceways/wcp
Browse files Browse the repository at this point in the history
update dockerfile and config path
  • Loading branch information
zhongjun2 authored Aug 2, 2024
2 parents 488c76b + f675307 commit 161b838
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 12 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ENV LC_ALL C.UTF-8

WORKDIR /var/lib/ds/datastat-server
COPY . /var/lib/ds/datastat-server

ENV CONFIG_PATH=/opt/config

RUN mvn clean install package -Dmaven.test.skip && \
mv ./target/ds-0.0.1-SNAPSHOT.jar ../ds.jar

Expand All @@ -35,4 +38,4 @@ RUN useradd -u 1000 datastat -s /bin/bash -m -U && \
chown -R datastat:datastat om-data

USER datastat
CMD java -jar ds.jar
CMD java -jar ds.jar --spring.config.location=${CONFIG_PATH}/application.properties
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@
<artifactId>tomcat-embed-websocket</artifactId>
<version>10.1.25</version>
</dependency>


</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/FoundryConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "foundry")
@PropertySource(value = {"file:${user.dir}/foundry.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/foundry.properties"}, encoding = "UTF-8")
@Configuration("foundryConf")
@Data
public class FoundryConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/MindSporeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "mindspore")
@PropertySource(value = {"file:${user.dir}/mindSpore.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/mindspore.properties"}, encoding = "UTF-8")
@Configuration("mindsporeConf")
@Data
public class MindSporeConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenEulerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "openeuler")
@PropertySource(value = {"file:${user.dir}/openEuler.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/openeuler.properties"}, encoding = "UTF-8")
@Configuration("openeulerConf")
@Data
public class OpenEulerConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenGaussConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.springframework.core.env.Environment;

@ConfigurationProperties(prefix = "opengauss")
@PropertySource(value = {"file:${user.dir}/openGauss.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/opengauss.properties"}, encoding = "UTF-8")
@Configuration("opengaussConf")
@Data
public class OpenGaussConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenLookengConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "openlookeng")
@PropertySource(value = {"file:${user.dir}/openLookeng.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/openlookeng.properties"}, encoding = "UTF-8")
@Configuration("openlookengConf")
@Data
public class OpenLookengConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/QueryConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "custom")
@PropertySource(value = {"file:${user.dir}/custom.properties"})
@PropertySource(value = {"file:${config.path}/custom.properties"})
@Configuration("queryConf")
@Data
public class QueryConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/SoftwareConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import lombok.Data;

@ConfigurationProperties(prefix = "software")
@PropertySource(value = {"file:${user.dir}/software.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/software.properties"}, encoding = "UTF-8")
@Configuration("softwareConf")
@Data
public class SoftwareConfig extends CustomPropertiesConfig {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/datastat/dao/QueryDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,6 @@ public String queryCommunityCoreRepos(CustomPropertiesConfig queryConf) {
put("isCoreRepo", repoListStr.contains(repository) ? "1" : "0");
}});
}

return resultJsonStr(200, objectMapper.valueToTree(res), "ok");
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/datastat/service/QueryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1518,4 +1518,3 @@ public String putNpsIssue(HttpServletRequest request, String community, NpsIssue
}

}

0 comments on commit 161b838

Please sign in to comment.