-
-
Notifications
You must be signed in to change notification settings - Fork 32
Install with Docker
Note
There are multiple ways you can host BookLogr. This guide goes through the recommended way of installing it on your own hardware but depending on your needs certain steps can be altered as you deem neccessary.
Start by cloning the BookLogr release into a suitable directory,
git clone --branch v1.0.0 --single-branch https://github.com/Mozzo1000/booklogr.git
Go to the booklogr directory and copy the .env.example file and rename it to .env. Edit the .env file as needed.
See ENV-variables.md for more information
In the docker-compose.yml file, there are some values that need to be changed. These are marked with a comment CHANGE THIS FOR USE IN PRODUCTION!
From the booklogr directory, run docker compose up -d to start all docker services in the background.
It is recommended to use a reverse proxy for the docker containers when wanting to access them externally.
sudo nano /etc/nginx/sites-available/api.booklogr
Paste the following inside the file,
server {
server_name api.YOUR_DOMAIN;
location / {
proxy_pass http://127.0.0.1:5002;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}Change api.YOURDOMAIN to the public domain you want the api service to be accessible from.
sudo nano /etc/nginx/sites-available/auth.booklogr
Paste the following inside the file,
server {
server_name auth.YOUR_DOMAIN;
location / {
proxy_pass http://127.0.0.1:5001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}Change auth.YOURDOMAIN to the public domain you want the api service to be accessible from.
sudo ln -s /etc/nginx/sites-available/api.booklogr /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/auth.booklogr /etc/nginx/sites-enabled/sudo systemctl restart nginx
Go to the web directory and copy the .env.example file and rename it to .env.
Edit this .env file as needed. Primarily, the env variables VITE_API_ENDPOINT and VITE_AUTH_API_URL need to reflect the IP/hostname of the services exposed through the proxy service.
Example for https://demo.booklogr.app, the .env file looks like:
VITE_API_ENDPOINT="https://api.booklogr.app"
VITE_AUTH_API_URL="https://auth.booklogr.app"
VITE_GOOGLE_CLIENT_ID=XXX.apps.googleusercontent.com
VITE_DISABLE_HOMEPAGE=trueSee also ENV-variables.md for more information
From web directory, run npm install and npm run build.
Copy the files created in the dist folder to your web server.
Note
Building the web interface does not need to be done on the server that will host the files.
Note
You do not need to use Nginx. Apache or any other web server able to serve HTML and Javascript files should work.
Create a directory for the html files,
sudo mkdir /var/www/booklogr
Copy all files from the dist folder from the step above to /var/www/booklogr
sudo nano /etc/nginx/sites-available/booklogr-web
Paste the following inside the file,
server {
listen 80;
listen [::]:80;
root /var/www/booklogr;
index index.html index.htm;
server_name YOUR_DOMAIN;
location / {
try_files $uri $uri/ =404;
}
}sudo ln -s /etc/nginx/sites-available/booklogr-web /etc/nginx/sites-enabled/
sudo systemctl restart nginx
🎉 You should now be able to go to YOUR_DOMAIN and have a working BookLogr service running! 🎉
Tip
It is recommended to use an SSL certificate for all web services, especially if you are hosting BookLogr for external use.