Home > other >  How the docker - compose. Specify the Spring in yml boot used mirror mount path configuration files
How the docker - compose. Specify the Spring in yml boot used mirror mount path configuration files

Time:09-20

I use Spring boot developed a simple web application, use docker - compose specify compilation, compilation is successful, but how can pass the docker - compose. The configuration in the yml, specified on the container application configuration file, outside the image configuration? For example application. The properties file, outside the image, how to use dokcer - compose. (volumes) specified in the yml in mirror external load path? I docker below - compse. Yml Settings not make

Docker - compse. Yml
Version: '3'

Services:
Elasticsearch:
Build: elasticsearch
Ports:
9200-9200:
Expose:
- 9300
Environment:
- "ES_JAVA_OPTS=- Xms512m - Xmx512m"
Networks:
- "internal"
Volumes,
- esdata:/usr/share/elasticsearch/data
-./elasticsearch/config/elasticsearch. Yml:/usr/share/elasticsearch/config/elasticsearch. Yml
Ulimits:
Nofiles:
Soft: 65536
Hard: 65536

Kibana:
Image: docker. Elastic. Co/kibana/kibana: 5.6.4
Networks:
- "internal"
Ports:
5601-5601:
Elasticsearch - head:
Image: mobz/elasticsearch - head: 5
Networks:
- "internal"
Ports:
9100-9100:
App:
Build: the helloWorld
Ports:
9090-9090:
Expose:
- 9090
Networks:
- "internal"
volumes:
-./helloWorld/config/hello. Yml:/app/hello.html yml

(not make)
Volumes,
Esdata:
Driver: local

Networks:
Internal:
Driver: "the bridge"

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
DockerFile

The FROM Java: 8
VOLUME/TMP
RUN the mkdir/app
ADD the HelloWorld - 0.0.1 - the SNAPSHOT. Jar/app/app. The jar
The ADD runboot. Sh/app/
The RUN bash - c 'touch/app/app. Jar'
WORKDIR/app
The RUN chmod + x a runboot. Sh
EXPOSE 9090
CMD/app/runboot. Sh

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Runboot. Sh

Sleep 10
Java - Djava. Security. Or egd=file:/dev/./urandom - jar/app/app. The jar

CodePudding user response:

The building Lord solved
  • Related