I'm super frustrated trying to get Docker's watch feature to actually work as expected. I'm using Docker Compose with the `--watch` flag, but it doesn't seem to mount my files and directories before syncing. Here's a snippet of my service configuration:
```yaml
searxng:
container_name: searxng
image: docker.io/searxng/searxng:latest
restart: unless-stopped
networks:
- searxng
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./searxng:/etc/searxng
- ./simple-custom-fork:/usr/local/searxng/searx/static/themes/simple
- searxng-data:/var/cache/searxng:rw
environment:
- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
- SEARXNG_SECRET=$SEARXNG_SECRET
develop:
watch:
- action: sync+restart
path: ./searxng
target: /etc/searxng
- action: restart
path: ./docker-compose.yaml
```
I'm running the command with `docker compose up --watch`. While the `./simple-custom-fork` directory works when mounted directly in `volumes:`, it doesn't work when I try to use the watch actions. The same issue occurs with `./searxng`. Is this a bug or am I missing something in my setup?
3 Answers
Have you checked if ditching the `watch` option affects the mounting of your volumes? Also, when you bring your containers down using the `volumes` flag, can you recreate fresh volumes when you spin them back up?
One thing you could try is removing the `--watch` flag altogether. It might solve your volume mount issue since `docker compose up` by itself will tail the logs by default. If you want to deploy without that log watching, just add `-d` at the end of your command.
I get that you want to watch for changes, but it might be necessary to tweak your approach for the time being. Let me know how you resolve it!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically