From a8f70df1fbfd49bf8a7788bd6cbc2699e4d73caf Mon Sep 17 00:00:00 2001 From: Houmgaor Date: Tue, 17 Feb 2026 15:16:57 +0100 Subject: [PATCH] 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 --- .gitignore | 3 ++ README.md | 2 + docker/README.md | 110 +++++++++++++++----------------------- docker/docker-compose.yml | 34 ++++-------- 4 files changed, 59 insertions(+), 90 deletions(-) diff --git a/.gitignore b/.gitignore index 3b40bee33..fb41fd5ce 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ savedata/*/ *.lnk *.bat /docker/db-data +/docker/savedata +/docker/bin +/docker/config.json screenshots/* # We don't need built files diff --git a/README.md b/README.md index a0a773021..9d9723ee8 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ Docker handles the database automatically. You only need to provide quest files pgAdmin is available at `http://localhost:5050` for database management. + See [docker/README.md](./docker/README.md) for more details (local builds, troubleshooting). + ### Option B: Pre-compiled Binary 1. Download the latest release for your platform from [GitHub Releases](https://github.com/Mezeporta/Erupe/releases/latest): diff --git a/docker/README.md b/docker/README.md index 6d3a555f9..bedd3faeb 100644 --- a/docker/README.md +++ b/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. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6f01a9d10..759b16b87 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,18 +1,16 @@ -version: "3.9" -# 1. docker-compose up db pgadmin -# 2. Use pgadmin to restore db and also apply patch-schema -# 3. Configure the config.json example. in docker you can point to the service name for the database i.e db -# 4. In seperate terminal docker-compose up server -# 5. If all went well happy hunting! -services: +# 1. Copy config.example.json to docker/config.json and edit it +# (set Database.Host to "db", adjust password to match below) +# 2. Place quest/scenario files in docker/bin/ +# 3. docker compose up +services: db: - image: postgres + image: postgres:18-alpine environment: - # (Make sure these match config.json) + # Change this password and match it in docker/config.json - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password - POSTGRES_DB=erupe - ports: + ports: - "5432:5432" volumes: - ./db-data/:/var/lib/postgresql/data/ @@ -44,8 +42,8 @@ services: # build: # context: ../ volumes: - - ../config.json:/app/erupe/config.json - - ../bin:/app/erupe/bin + - ./config.json:/app/erupe/config.json + - ./bin:/app/erupe/bin - ./savedata:/app/erupe/savedata ports: # (Make sure these match config.json) @@ -53,7 +51,7 @@ services: - "8080:8080" #Sign V2 - "53310:53310" #Entrance # Channels - - "54001:54001" + - "54001:54001" - "54002:54002" - "54003:54003" - "54004:54004" @@ -61,13 +59,3 @@ services: - "54006:54006" - "54007:54007" - "54008:54008" - web: - image: httpd:latest - container_name: my-apache-app - ports: - - '80:80' - volumes: - - ./Servers:/usr/local/apache2/htdocs - depends_on: - db: - condition: service_healthy \ No newline at end of file