mirror of
https://gitlab.bmcstudios.org/public_projects/swg-server-docker.git
synced 2026-07-14 00:03:24 -04:00
master
SWG Docker Environment
This project sets up a comprehensive development environment for SWG using Docker.
Getting Started
1. Setup
- Clone this repository.
- (Optional) Create a
.envfile to configure a custom repository or database credentials (see Configuration below). - Build and start the services:
docker compose up -d --build
2. Build the Server
- Access the
swgcontainer shell:docker exec -it swg bash - Compile the game and assets (run once):
ant swg
3. Run the Server
Inside the container shell:
- Start:
ant start & - Stop:
ant stop
Client Configuration
To connect your client, edit login.cfg in your client directory. Set loginServerAddress0 to 127.0.0.1 (local) or the host IP (remote).
[Station]
subscriptionFeatures=1
gameFeatures=65535
[ClientGame]
loginServerPort0=44453
loginServerAddress0=127.0.0.1
Note: If you are hosting remotely, ensure the
CLUSTER_LISTIP in the database matches your remote IP. See Troubleshooting.
Docker Management
-
Stop Containers (Keep Data):
docker compose downPreserves database and
swg-mainvolume. -
Wipe Environment (Delete Data):
docker compose down -vRemoves all volumes. You will need to recompile (
ant swg) after this.
Configuration
Create a .env file in the project root to override defaults.
Example .env:
# Project Name (Prefix for containers/volumes)
COMPOSE_PROJECT_NAME=swg
# Git Repository (Default: https://github.com/SWG-Source/swg-main.git)
REPO_URL=https://github.com/Your-Repo/swg-main.git
# Private Repo Credentials (Optional)
REPO_USERNAME=your-username
REPO_PASSWORD=your-token
# Database Credentials (Optional - Default: swg/swg)
DB_USER=swg
DB_USER_PASSWORD=swg
Developer Guide
Copying Files from Container
To copy compiled files (e.g., TRE files) from the container to your host:
docker cp swg:/swg-main/path/to/file "C:\Local\Path"
Example:
docker cp swg:/swg-main/data/sku.0/sys.shared/compiled/game/datatables/buff/buff.iff "C:\Users\username\Desktop\ServerFiles"
Troubleshooting
For common issues such as:
- Stuck at "Connecting" or Galaxy selection.
ant swgbuild errors (git overwrites).- Database connection problems.
Please refer to DEBUGGING.md.
Languages
Dockerfile
64.6%
Shell
35.4%