blob: f063a54ffc8941a26f04778f19cf571097fad193 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
#+date: <2025-01-23 Thursday 20:44:45>
#+title: Self-Hosting Tandoor Recipe Manager
#+description: Learn how to self-host Tandoor, the smart recipe management web app.
#+filetags: :self-hosting:
#+slug: self-hosting-tandoor
* Overview
[[https://tandoor.dev/][Tandoor]] is a smart recipe manager web application that allows you to:
- Store your recipes
- Search for recipes and ingredients
- Share recipes with a link and permission system
- Put recipes and ingredients into a shopping list
- Plan your meals with a built-in calendar
- Calculate nutritional values
- Import recipes from websites and apps
- Load existing recipes
* Installation
[[https://docs.tandoor.dev/][The Tandoor docs]] contain all of the relevant information needed to get start
with the self-hosting process.
This tutorial will use Docker Compose and Nginx on Ubuntu 24.04.1.
** Docker Compose
On your machine, create a directory for Tandoor and copy down the =.env= and
=docker-compose.yml= templates:
#+begin_src shell
mkdir ~/tandoor cd ~/tandoor wget
https://raw.githubusercontent.com/vabene1111/recipes/develop/.env.template -O .env wget
# Plain version of docker-compose.yml
https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/plain/docker-compose.yml
#+end_src
Within these files, customize as needed.
- =.env=
- Add a =SECRET_KEY=
- Define the =ALLOWED_HOSTS=
- Set the =POSTGRES_PASSWORD=
- =docker-compose.yml=
- Update the =ports= since Nginx on my host is already using port 80 (e.g.
=8087:80=)
Once you've updated and saved the files, you can launch the container.
#+begin_src shell
sudo docker compose up -d
#+end_src
The application is now available at =localhost:8087= or =ip_address:8087= if
accessing via a different machine. If accessing via a different machine,
remember to allow port =8087= through any existing firewalls.
** Nginx Reverse Proxy
Now that Tandoor is available locally, let's connect it to the Nginx web server
running on the host machine.
#+begin_quote
Note: I use Nginx configuration files within the =conf.d= directory, but you may
need to use the =sites-available= directory, depending on your installation of
Nginx.
#+end_quote
#+begin_src shell
cd /etc/nginx/conf.d/
sudo nano recipes.conf
#+end_src
Within this file, define your website configuration. The example below is my
default configuration and utilizes a wildcard certificate for =*.example.com=
that covers all of my subdomains. If you don't have a wildcard certificate, you
will need to generate an SSL certificate for your domain.
#+begin_src config
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name recipes.example.com;
# SSL
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
# reverse proxy
location / {
proxy_pass http://localhost:8087/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect http://127.0.0.1:8080 https://recipes.example.com;
}
location /media/ {
root /media/;
index index.html index.htm;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name recipes.example.com;
include custom.d/letsencrypt.conf;
if ($host ~ ^[^.]+\.example\.com$) {
return 301 https://$host$request_uri;
}
}
#+end_src
Save and close the configuration file and then restart the web server.
#+begin_src shell
sudo systemctl restart nginx.service
#+end_src
The app is now available on your custom domain!
** Screenshots
#+caption: Login
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/login.png]]
#+caption: Recipes
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/recipes.png]]
#+caption: Meal Plan
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/mealplan.png]]
#+caption: Shopping Lists
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/shopping.png]]
#+caption: Cook Book
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/cookbook.png]]
#+caption: Import
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/import.png]]
#+caption: Administration Panel
[[https://img.cleberg.net/blog/20250123-self-hosting-tandoor/admin.png]]
|