Fork me on GitHub

Herr Knedel/Great things with containers: manage and archive recipes on Synology DiskStation

Created Sun, 07 Mar 2021 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:11:12 +0000 Difficulty level: Can be done by anyone

543 Words

Collect all your favorite recipes in Docker container and organize them according to your needs. Write your own recipes or import recipes from websites, for example “Chef”, “Food

Option for professionals

Of course, as an experienced Synology user, you can log in right away with SSH and install the whole setup via Docker Compose file.

version: "2.0"
services:
  mealie:
    container_name: mealie
    image: hkotel/mealie:latest
    restart: always
    ports:
      - 9000:80
    environment:
      db_type: sqlite
      TZ: Europa/Berlin
    volumes:
      - ./mealie/data/:/app/data

Step 1: Find Docker image

I click on the “Registry” tab in the Synology Docker window and search for “mealie”. I select the Docker image “hkotel/mealie:latest” and then click on the tag “latest”.

After the image download, the image is available as an image. Docker distinguishes between 2 states, container “dynamic state” and image/image (fixed state). Before we now create a container from the image, a few settings must be made.

Step 2: Put image/image into operation:

I double-click on my “mealie” image.

After that I click on “Advanced settings” and activate the “Automatic restart”. I select the “Volume” tab and click on “Add Folder”. There I create a new folder with this mount path “/app/data”. I assign fixed ports for the “Mealie” container. Without fixed ports it could be that the “mealie server” runs on another port after a restart. Finally, I enter two environment variables. The variable “db_type” is the database type and “TZ” the time zone “Europe/Berlin”. After these settings Mealie server can be started! After that you can call Mealie via the Ip address of the Synology disctation and the assigned port, for example http://192.168.21.23:8096 .

How does Mealie work?

If I move the mouse over the “Plus” button on the right/bottom and then click on the “Chain” icon, I can enter a url. The Mealie application then searches for the required meta and schema information on its own.

The import works great (I have used these functions with urls from Chef, food In edit mode I can also add a category. It is important that I press the “Enter” key once after each category. Otherwise this setting will not be applied.

Special features

I noticed that the menu categories do not update automatically. Here you have to help with a browser reload.

Other features

Of course, you can search for recipes and also create menus. Besides, you can customize “Mealie” very extensively.

Mealie also looks great on mobile:

Rest Api

At “http://gewaehlte-ip:und-port … /docs” you can find the API documentation. Here you can find many method that can be used for automation.

Api example

Imagine the following fiction: “Gruner und Jahr introduces the Internet portal Essen

x
+
Terminal

$ wget --spider --force-html -r -l12 "https://www.essen-und-trinken.de/rezepte/archiv/" 2>&1 | grep '/rezepte/' | grep '^--' | awk '{ print $3 }' > liste.txt

Then clean up this list and fire it against the rest api, example:

#!/bin/bash
sort -u liste.txt > clear.txt

while read p; do
  echo "import url: $p"
  curl -d "{\"url\":\"$p\"}" -H "Content-Type: application/json" http://synology-ip:8096/api/recipes/create-url
  sleep 1
done < clear.txt

Now you can reach the recipes offline:

Conclusion: If you put some time into Mealie, you can build a great recipe database! Mealie is constantly being developed as an open source project and can be found at the following address https://github.com/hay-kot/mealie/