rudeshark.net/docs/docker.md

49 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2023-07-03 00:18:30 +02:00
# 🐳 Running a Firefish server with Docker
## Pre-built docker container
2023-07-23 13:57:54 +02:00
[registry.joinfirefish.org/firefish/firefish](https://git.joinfirefish.org/firefish/firefish/container_registry)
2022-12-16 23:34:27 +01:00
## `docker-compose`
There is a `docker-compose.yml` in the root of the project that you can use to build the container from source
2023-09-25 03:12:21 +02:00
- .config/docker_example.env (**db config settings**)
2023-07-03 00:18:30 +02:00
- .config/default.yml (**firefish server settings**)
2022-12-16 23:34:27 +01:00
## Configuring
Rename the files:
2023-03-23 22:45:33 +01:00
`cp .config/example.yml .config/default.yml`
2023-09-25 03:12:21 +02:00
`cp .config/docker_example.env .config/docker.env`
then edit them according to your environment.
You can configure `docker.env` with anything you like, but you will have to pay attention to the `default.yml` file:
2023-06-02 21:16:36 +02:00
- `url` should be set to the URL you will be hosting the web interface for the server at.
2023-07-03 00:18:30 +02:00
- `host`, `db`, `user`, `pass` will have to be configured in the `PostgreSQL configuration` section - `host` is the name of the postgres container (eg: *firefish_db_1*), and the others should match your `docker.env`.
- `host`will need to be configured in the *Redis configuration* section - it is the name of the redis container (eg: *firefish_redis_1*)
2023-03-23 22:45:33 +01:00
- `auth` will need to be configured in the *Sonic* section - cannot be the default `SecretPassword`
2022-12-13 05:22:39 +01:00
Everything else can be left as-is.
## Running docker-compose
2022-12-16 23:34:27 +01:00
2023-07-23 13:57:54 +02:00
The [prebuilt container for firefish](https://git.joinfirefish.org/firefish/firefish/container_registry) is fairly large, and may take a few minutes to download and extract using docker.
2022-12-13 05:22:39 +01:00
Copy `docker-compose.yml` and the `config/` to a directory, then run the **docker-compose** command:
`docker-compose up -d`.
2023-07-03 00:18:30 +02:00
NOTE: This will take some time to come fully online, even after download and extracting the container images, and it may emit some error messages before completing successfully. Specifically, the `db` container needs to initialize and so isn't available to the `web` container right away. Only once the `db` container comes online does the `web` container start building and initializing the firefish tables.
2023-07-03 00:18:30 +02:00
Once the server is up you can use a web browser to access the web interface at `http://serverip:3000` (where `serverip` is the IP of the server you are running the firefish server on).
2022-12-16 23:34:27 +01:00
## Docker for development
```sh
cd dev/
docker-compose build
docker-compose run --rm web pnpm run init
2022-12-16 23:34:27 +01:00
docker-compose up -d
```