Skip to content

Does it work with mounted volumes with Docker? #86

@chrisvoo

Description

@chrisvoo

Hi!
This is just a question to investigate if you had the chance to test it within a Docker context.
Currently, I have a Java 8 microservice with a watching thread (using java.nio.file.WatcherService) that listens to changes to a bind-mounted directory. Here is the relevant part inside the docker-compose config:

services:
  filemanager:
    container_name: filemanager
    restart: always
    build:
      context: filemanager
      dockerfile: Dockerfile
    image: filemanager:latest
    ports:
      - ${FILE_MANAGER_PORT}:${FILE_MANAGER_PORT}
    environment:
      - FILE_MANAGER_PORT=${FILE_MANAGER_PORT}
      - MUSIC_DIRECTORY=${MUSIC_CONTAINER_DIRECTORY}
      - MYSQL_HOST=${MYSQL_CONTAINER_NAME}
      - MYSQL_PORT=${MYSQL_LOCAL_PORT}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - ENV=DEVELOPMENT
    volumes:
      - ${MUSIC_LOCAL_DIRECTORY}:${MUSIC_CONTAINER_DIRECTORY}
    depends_on:
      - mysql

If I run it without Docker or modify files directly inside Docker, the events are correctly dispatched and captured. If instead, I modify files on Ubuntu (MUSIC_LOCAL_DIRECTORY), just the files are modified inside the container but no events get captured.
I'm trying to understand if I need to do something different or if this feature cannot be used in this context (as said in this post for example). Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions