Skip to content

Commit

Permalink
Updated docker-compose and README for new setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tenekev committed Dec 29, 2023
1 parent 89243d8 commit 9b83d16
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,20 @@ The server is written in C# using ASP.NET Core. The codebase can be developed, b

<br>

# Self-hosting

# Self-hosting
Librum-Server can easily be self-hosted. This way all your data and books remain on your own devices and are not synchronized to the official cloud.
<br>
<br>
There are two options for self-hosting Librum-Server:
1. The first one is running a service on your linux server for which you can find instructions [here](self-hosting/self-host-installation.md).<br>
2. The other option is to run it via Docker which is described in the [next section](https://github.com/Librum-Reader/Librum-Server#running-with-docker).<br>


<br>

# Running with Docker

Librum-Server can be run with Docker. We currently do not provide images in DockerHub so you'll need to build it yourself.
## 🐋 With Docker
Librum-Server can be run with Docker. We provide a [docker-compose.yml](docker-compose.yml) file as well as our own images. We are using GitHub's `ghrc.io` Container Registry.

```bash
git clone https://github.com/Librum-Reader/Librum-Server
cd Librum-Server
docker build . -t librum
```
wget https://github.com/Librum-Reader/Librum-Server/raw/main/docker-compose.yml

Librum will also need a database. You can use [our sample docker-compose.yml file](docker-compose.yml) as a guide for setting it up.
docker compose up -d
```

## 📃 Manual installation
If you don't like Docker, you can also selfhost Librum-Server by running it as a service on your linux server. Instructions can be found [here](self-hosting/self-host-installation.md).

<br>

Expand Down
24 changes: 16 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: "3.8"
services:
librum:
image: librum
image: ghcr.io/librum-reader/librum-server:latest
hostname: librum
container_name: librum
ports:
Expand All @@ -12,18 +12,20 @@ services:
volumes:
- librum:/var/lib/librum-server/librum_storage
environment:
- JWTValidIssuer=exampleIssuer
- JWTKey=exampleOfALongSecretToken
- SMTPEndpoint=smtp.example.com
- SMTPUsername=mailuser123
- JWTValidIssuer=exampleIssuer # Optional. You can leave it as-is
- JWTKey=exampleOfALongSecretToken # Optional. You can leave it as-is
- SMTPEndpoint=smtp.example.com # Example for Gmail: smtp.gmail.com:587
- SMTPUsername=mailuser123
- SMTPPassword=smtpUserPassword123
- [email protected]
- DBConnectionString=Server=mariadb;port=3306;Database=librum;Uid=librum;Pwd=mariadb;
- [email protected]
- AdminPassword=strongPassword123
- [email protected] # Admin login username
- AdminPassword=strongPassword123 # Admin login password
#- OpenAIToken= # Optional. Generate here: https://platform.openai.com/api-keys
restart: unless-stopped
depends_on:
- librum_db
librum_db:
condition: service_healthy # Ensures the DB is up before the server.

librum_db:
image: mariadb:latest
Expand All @@ -39,6 +41,12 @@ services:
- MARIADB_DATABASE=librum
- MARIADB_ROOT_PASSWORD=mariadb
restart: unless-stopped
healthcheck: # Ensures the DB is up before the server.
test: ["CMD", "mariadb-admin", "ping", "-u", "librum", "-p'mariadb'", "-h", "localhost"]
interval: 20s
timeout: 40s
retries: 3
start_period: 30s

networks:
librum:
Expand Down

0 comments on commit 9b83d16

Please sign in to comment.