Improved docker-related info in README

This commit is contained in:
Donkie
2023-07-07 18:23:03 +02:00
parent 517cbfc8b6
commit 4da5518c10

View File

@@ -18,16 +18,15 @@ It exposes a REST API which backends can interact with. See the [OpenAPI descrip
It also ships with a simple web-based UI that lets you manipulate the stored data, add filaments, etc. It also ships with a simple web-based UI that lets you manipulate the stored data, add filaments, etc.
## Installation ## Installation
The data can be stored in any of the following databases: SQLite, PostgreSQL, MySQL, MariaDB, CockroachDB.
By default, SQLite is used which is a simple no-install database solution that saves to a single .db file located in the server's user directory.
### Using Docker ### Using Docker
The easiest way to run Spoolman is using Docker. Docker is a platform for developing, shipping, and running applications in containers. Containers are lightweight, portable, and self-contained environments that can run on any machine with Docker installed. The easiest way to run Spoolman is using Docker. Docker is a platform for developing, shipping, and running applications in containers. Containers are lightweight, portable, and self-contained environments that can run on any machine with Docker installed.
To install Docker on your machine, follow the instructions for your operating system on the [Docker website](https://docs.docker.com/engine/install/). Once you have Docker installed, you can use the sample `docker-compose.yml` file below to run Spoolman in a container. To install Docker on your machine, follow the instructions for your operating system on the [Docker website](https://docs.docker.com/engine/install/). Docker also includes the docker-compose tool which lets you configure the container deployment in a simple yaml file, without having to remember all the command line options.
The data can be stored in any of the following databases: SQLite, PostgreSQL, MySQL, MariaDB, CockroachDB. Here is a sample docker-compose config to get you started. Copy-paste it into a file called `docker-compose.yml` and run `docker-compose up -d` to start it. If you want to use the SQLite database as in this sample, you must first create a folder called `data` in the same directory as the `docker-compose.yml`, then you should run `chown 1000:1000 data` on it in order to give it the correct permissions for the user inside the docker container.
By default, SQLite is used which is a simple no-install database solution that saves to a single .db file located in the server's user directory.
Here is a sample docker-compose.yml to get you started:
```yaml ```yaml
version: '3.8' version: '3.8'
services: services:
@@ -41,10 +40,10 @@ services:
environment: environment:
- TZ=Europe/Stockholm # Optional, defaults to UTC - TZ=Europe/Stockholm # Optional, defaults to UTC
``` ```
With this example, you should first create a folder called `data` in the same directory as the docker-compose.yml, then you should run `chown 1000:1000 data` on it in order to give it the correct permissions for the user inside the docker container.
Once you have it up and running, you can access the web UI by browsing to `http://your.ip:7912`. Once you have it up and running, you can access the web UI by browsing to `http://your.ip:7912`.
If a new version of Spoolman has been released, you can update to it by first browsing to the directory where you have the `docker-compose.yml` file and then running `docker-compose pull && docker-compose up -d`.
If you want to connect with an external database instead, specify the `SPOOLMAN_DB_*` environment variables from the table below. If you want to connect with an external database instead, specify the `SPOOLMAN_DB_*` environment variables from the table below.
| Variable | Description | | Variable | Description |