wger-project / docker

Production...ish docker-compose image for wger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker compose misses mount for media folder in celery worker entry

strawpants opened this issue · comments

Thanks for developing this!

I'm experimenting with setting up my own wger instance with docker,and I've had some problems getting the search function working properly. The nginx logs showed a lot of http errors (499,500) for missing or not found ingredient images.

I could fix this by adding the mount for the media folder to the celery_worker service. The celery worker was downloading the ingredient images but since the folder was not mounted there the images in the /home/wger/media/ingredients folder were not available for nginx to host.

Images are now displayed and the search bar seems to work better.

TLDR;
add

volumes:
      - media:/home/wger/media

to the celery_worker entry in the docker-compose.yml.

Roelof

Thanks for reporting this, that makes sense. I'm not sure whether the new ingredients are half broken (entry in db but no file on disk) or the process failed completetly

FYI: the downloading of the images and subsequent registration in the db actually worked. But the images were stored inside the celery_worker container, so the links in the db (nutrition_images) were created and correct but pointing to an inaccessible resource.

Besides mounting the media folder to the celery_worker, I had to truncate the nutrition_image table to trigger a renewed downloading of the images, after that it worked.

Note: I did use DOWNLOAD_INGREDIENTS_FROM=OFF because I experienced some errors: 'No ingredient matches UUID in the remote server' when using ..=WGER