I've a container which runs a java process via a jar file. (springboot application based)
My jar is using en vars from the container , thus my application.yml looks like this :
application.yml :
spring:
profiles:
active: server
datasource:
url: ${DATASOURCE_URL}
databaseName:
serverName:
username: ${DATASOURCE_USERNAME}
password: ${DATASOURCE_PASSWORD}
dataSourceClassName: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
registerMbeans: true
maxPoolSize: ${DATASOURCE_MAXPOOLSIZE}
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
data:
couchbase:
nodes:
- ${COUCHBASE_NODE_1}
- ${COUCHBASE_NODE_2}
bucket: ${COUCHBASE_BUCKET}
password: ${COUCHBASE_PASSWORD}
port: ${COUCHBASE_PORT}
Where , DATASOURCE_USERNAME
, DATASOURCE_PASSWORD
... are the env var of the container itself
My problem is where to define / declare thos variable , i ve tried to incldue it inside .bachrc
, withinin a file , like this :
.bachrc :
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
########## CONFIGS FILES ############
source $HOME/envfile.list
and envfile.list look like this :
envfile.list:
DATASOURCE_USERNAME="aaa"
DATASOURCE_PASSWORD="bbb"
...
My pb is that my java process cannot see those variables , NOTE : i want to set those variables explicitlyt , without docker run -e
suggestions ?