mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix: clean up Docker setup (compose, README, gitignore)
- Remove deprecated version field from docker-compose.yml - Pin Postgres to 18-alpine (matches existing db-data) - Remove undocumented web (Apache) service - Fix config/bin volume mounts to use docker/ directory - Gitignore docker/savedata, docker/bin, docker/config.json - Rewrite docker/README.md: fix typos, use docker compose V2 commands, match actual compose file behavior - Link docker/README.md from main README Docker section
This commit is contained in:
110
docker/README.md
110
docker/README.md
@@ -1,86 +1,62 @@
|
||||
# Docker for erupe
|
||||
# Docker for Erupe
|
||||
|
||||
## Building the container
|
||||
## Quick Start
|
||||
|
||||
Run the following from the route of the source folder. In this example we give it the tag of dev to seperate it from any other container verions.
|
||||
1. From the repository root, copy and edit the config:
|
||||
|
||||
```bash
|
||||
cp config.example.json docker/config.json
|
||||
```
|
||||
|
||||
Edit `docker/config.json` — set `Database.Host` to `"db"` and match the password to `docker-compose.yml` (default: `password`).
|
||||
|
||||
2. Place your [quest/scenario files](https://files.catbox.moe/xf0l7w.7z) in `docker/bin/`.
|
||||
|
||||
3. Start everything:
|
||||
|
||||
```bash
|
||||
cd docker
|
||||
docker compose up
|
||||
```
|
||||
|
||||
The database is automatically initialized and patched on first start via `init/setup.sh`.
|
||||
|
||||
pgAdmin is available at `http://localhost:5050` (default login: `user@pgadmin.com` / `password`).
|
||||
|
||||
## Building Locally
|
||||
|
||||
By default the server service pulls the prebuilt image from GHCR. To build from source instead, edit `docker-compose.yml`: comment out the `image` line and uncomment the `build` section, then:
|
||||
|
||||
```bash
|
||||
docker build . -t erupe:dev
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
## Running the container in isolation
|
||||
|
||||
This is just running the container. You can do volume mounts into the container for the `config.json` to tell it to communicate to a database. You will need to do this also for other folders such as `bin` and `savedata`
|
||||
## Stopping the Server
|
||||
|
||||
```bash
|
||||
docker run erupe:dev
|
||||
docker compose stop # Stop containers (preserves data)
|
||||
docker compose down # Stop and remove containers (preserves data volumes)
|
||||
```
|
||||
|
||||
## Docker compose
|
||||
To delete all persistent data, remove these directories after stopping:
|
||||
|
||||
Docker compose allows you to run multiple containers at once. The docker compose in this folder has 3 things set up.
|
||||
- `docker/db-data/`
|
||||
- `docker/savedata/`
|
||||
|
||||
- postgres
|
||||
- pg admin (Admin interface to make db changes)
|
||||
- erupe
|
||||
## Updating
|
||||
|
||||
We automatically populate the database to the latest version on start. If you you are updating you will need to apply the new schemas manually.
|
||||
After pulling new changes:
|
||||
|
||||
Before we get started you should make sure the database info matches whats in the docker compose file for the environment variables `POSTGRES_PASSWORD`,`POSTGRES_USER` and `POSTGRES_DB`. You can set the host to be the service name `db`.
|
||||
1. Check for new patch schemas in `schemas/patch-schema/` — apply them via pgAdmin or `psql` into the running database container.
|
||||
|
||||
Here is a example of what you would put in the config.json if you was to leave the defaults. It is strongly recommended to change the password.
|
||||
2. Rebuild and restart:
|
||||
|
||||
```txt
|
||||
"Database": {
|
||||
"Host": "db",
|
||||
"Port": 5432,
|
||||
"User": "postgres",
|
||||
"Password": "password",
|
||||
"Database": "erupe"
|
||||
},
|
||||
```
|
||||
|
||||
Place this file within ./docker/config.json
|
||||
|
||||
You will need to do the same for your bins place these in ./docker/bin
|
||||
|
||||
## Setting up the web hosted materials
|
||||
|
||||
Clone the Severs repo into ./docker/Severs
|
||||
|
||||
Make sure your hosts are pointing to where this is hosted
|
||||
|
||||
## Turning off the server safely
|
||||
|
||||
```bash
|
||||
docker-compose stop
|
||||
```
|
||||
|
||||
## Turning off the server destructive
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
Make sure if you want to delete your data you delete the folders that persisted
|
||||
|
||||
- ./docker/savedata
|
||||
- ./docker/db-data
|
||||
|
||||
## Turning on the server again
|
||||
|
||||
This boots the db pgadmin and the server in a detached state
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
if you want all the logs and you want it to be in an attached state
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
```bash
|
||||
docker compose down
|
||||
docker compose build
|
||||
docker compose up
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Q: My Postgres will not populate. A: You're setup.sh is maybe saved as CRLF it needs to be saved as LF.
|
||||
**Postgres won't populate on Windows**: `init/setup.sh` must use LF line endings, not CRLF. Open it in your editor and convert.
|
||||
|
||||
Reference in New Issue
Block a user