Mount log path
my-java:
container_name:
my-java
hostname:
my-java
build:
${PWD}/config/my-java
networks:
['stack']
command:
java
-jar
my-java.jar
volumes:
-
./logs/my-java/:/opt/my-java/logs/
filebeat:
container_name:
filebeat
hostname:
filebeat
image:
"docker.elastic.co/beats/filebeat:${ELASTIC_VERSION}"
volumes:
-
./logs/my-java/:/var/log/my-java/
-
./docker-compose/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
command:
filebeat
-e
networks:
['stack']