SWG Docker Environment

This project sets up a comprehensive development environment for SWG using Docker.

Getting Started

1. Setup

  1. Clone this repository.
  2. (Optional) Create a .env file to configure a custom repository or database credentials (see Configuration below).
  3. Build and start the services:
    docker compose up -d --build
    

2. Build the Server

  1. Access the swg container shell:
    docker exec -it swg bash
    
  2. 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_LIST IP in the database matches your remote IP. See Troubleshooting.

Docker Management

  • Stop Containers (Keep Data):

    docker compose down
    

    Preserves database and swg-main volume.

  • Wipe Environment (Delete Data):

    docker compose down -v
    

    Removes 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 swg build errors (git overwrites).
  • Database connection problems.

Please refer to DEBUGGING.md.

S
Description
No description provided
Readme
122 MiB
Languages
Dockerfile 64.6%
Shell 35.4%