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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,6 +8,9 @@ savedata/*/
|
|||||||
*.lnk
|
*.lnk
|
||||||
*.bat
|
*.bat
|
||||||
/docker/db-data
|
/docker/db-data
|
||||||
|
/docker/savedata
|
||||||
|
/docker/bin
|
||||||
|
/docker/config.json
|
||||||
screenshots/*
|
screenshots/*
|
||||||
|
|
||||||
# We don't need built files
|
# We don't need built files
|
||||||
|
|||||||
@@ -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.
|
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
|
### Option B: Pre-compiled Binary
|
||||||
|
|
||||||
1. Download the latest release for your platform from [GitHub Releases](https://github.com/Mezeporta/Erupe/releases/latest):
|
1. Download the latest release for your platform from [GitHub Releases](https://github.com/Mezeporta/Erupe/releases/latest):
|
||||||
|
|||||||
@@ -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
|
```bash
|
||||||
docker build . -t erupe:dev
|
cp config.example.json docker/config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the container in isolation
|
Edit `docker/config.json` — set `Database.Host` to `"db"` and match the password to `docker-compose.yml` (default: `password`).
|
||||||
|
|
||||||
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`
|
2. Place your [quest/scenario files](https://files.catbox.moe/xf0l7w.7z) in `docker/bin/`.
|
||||||
|
|
||||||
|
3. Start everything:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run erupe:dev
|
cd docker
|
||||||
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker compose
|
The database is automatically initialized and patched on first start via `init/setup.sh`.
|
||||||
|
|
||||||
Docker compose allows you to run multiple containers at once. The docker compose in this folder has 3 things set up.
|
pgAdmin is available at `http://localhost:5050` (default login: `user@pgadmin.com` / `password`).
|
||||||
|
|
||||||
- postgres
|
## Building Locally
|
||||||
- pg admin (Admin interface to make db changes)
|
|
||||||
- erupe
|
|
||||||
|
|
||||||
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.
|
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:
|
||||||
|
|
||||||
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`.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```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
|
```bash
|
||||||
docker-compose stop
|
docker compose up --build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Turning off the server destructive
|
## Stopping the Server
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose down
|
docker compose stop # Stop containers (preserves data)
|
||||||
|
docker compose down # Stop and remove containers (preserves data volumes)
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure if you want to delete your data you delete the folders that persisted
|
To delete all persistent data, remove these directories after stopping:
|
||||||
|
|
||||||
- ./docker/savedata
|
- `docker/db-data/`
|
||||||
- ./docker/db-data
|
- `docker/savedata/`
|
||||||
|
|
||||||
## Turning on the server again
|
## Updating
|
||||||
|
|
||||||
This boots the db pgadmin and the server in a detached state
|
After pulling new changes:
|
||||||
|
|
||||||
|
1. Check for new patch schemas in `schemas/patch-schema/` — apply them via pgAdmin or `psql` into the running database container.
|
||||||
|
|
||||||
|
2. Rebuild and restart:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker compose down
|
||||||
```
|
docker compose build
|
||||||
|
docker compose up
|
||||||
if you want all the logs and you want it to be in an attached state
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose up
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## 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.
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
version: "3.9"
|
# 1. Copy config.example.json to docker/config.json and edit it
|
||||||
# 1. docker-compose up db pgadmin
|
# (set Database.Host to "db", adjust password to match below)
|
||||||
# 2. Use pgadmin to restore db and also apply patch-schema
|
# 2. Place quest/scenario files in docker/bin/
|
||||||
# 3. Configure the config.json example. in docker you can point to the service name for the database i.e db
|
# 3. docker compose up
|
||||||
# 4. In seperate terminal docker-compose up server
|
|
||||||
# 5. If all went well happy hunting!
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:18-alpine
|
||||||
environment:
|
environment:
|
||||||
# (Make sure these match config.json)
|
# Change this password and match it in docker/config.json
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD=password
|
- POSTGRES_PASSWORD=password
|
||||||
- POSTGRES_DB=erupe
|
- POSTGRES_DB=erupe
|
||||||
@@ -44,8 +42,8 @@ services:
|
|||||||
# build:
|
# build:
|
||||||
# context: ../
|
# context: ../
|
||||||
volumes:
|
volumes:
|
||||||
- ../config.json:/app/erupe/config.json
|
- ./config.json:/app/erupe/config.json
|
||||||
- ../bin:/app/erupe/bin
|
- ./bin:/app/erupe/bin
|
||||||
- ./savedata:/app/erupe/savedata
|
- ./savedata:/app/erupe/savedata
|
||||||
ports:
|
ports:
|
||||||
# (Make sure these match config.json)
|
# (Make sure these match config.json)
|
||||||
@@ -61,13 +59,3 @@ services:
|
|||||||
- "54006:54006"
|
- "54006:54006"
|
||||||
- "54007:54007"
|
- "54007:54007"
|
||||||
- "54008:54008"
|
- "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
|
|
||||||
Reference in New Issue
Block a user