Update DockerSecretsProcessor.java
This commit is contained in:
parent
fbc904e5e8
commit
3b79604af2
@ -17,14 +17,15 @@ public class DockerSecretsProcessor implements EnvironmentPostProcessor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
||||||
Resource resource = new FileSystemResource("/run/secrets/db-password");
|
// Resource resource = new FileSystemResource("/run/secrets/db-password");
|
||||||
if (resource.exists() && System.getProperty("MYSQL_PASSWORD") == null) {
|
// if (resource.exists() && System.getProperty("MYSQL_PASSWORD") == null) {
|
||||||
try {
|
// try {
|
||||||
String dbPassword = StreamUtils.copyToString(resource.getInputStream(), Charset.defaultCharset());
|
// String dbPassword = StreamUtils.copyToString(resource.getInputStream(), Charset.defaultCharset());
|
||||||
System.setProperty("MYSQL_PASSWORD", dbPassword);
|
// System.setProperty("MYSQL_PASSWORD", dbPassword);
|
||||||
} catch (IOException e) {
|
// } catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
System.setProperty("MYSQL_PASSWORD", "db-57xsl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user