Skip to content

Commit 6d221a4

Browse files
committed
Add example .env and docker-compose files for Hytale server setup
1 parent 3d4fc03 commit 6d221a4

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

.env.example

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Hytale Server Authentication
2+
# Get these values from your Hytale server dashboard
3+
4+
# ============================================================
5+
# PRIMARY SERVER INSTANCE
6+
# ============================================================
7+
8+
# Session token for server authentication
9+
HYTALE_SERVER_SESSION_TOKEN=your_session_token_here
10+
11+
# Identity token for server authentication
12+
HYTALE_SERVER_IDENTITY_TOKEN=your_identity_token_here
13+
14+
# Owner UUID for server ownership verification
15+
HYTALE_SERVER_OWNER_UUID=your_owner_uuid_here
16+
17+
# Optional: Java memory settings (passed to entrypoint)
18+
# JAVA_OPTS=-Xms1G -Xmx4G
19+
20+
# ============================================================
21+
# ADDITIONAL SERVER INSTANCES (uncomment to enable)
22+
# Each instance requires its own set of tokens
23+
# ============================================================
24+
25+
# Server Instance 2 (port 5521)
26+
# HYTALE_SERVER_2_SESSION_TOKEN=your_session_token_here
27+
# HYTALE_SERVER_2_IDENTITY_TOKEN=your_identity_token_here
28+
# HYTALE_SERVER_2_OWNER_UUID=your_owner_uuid_here
29+
30+
# Server Instance 3 (port 5522)
31+
# HYTALE_SERVER_3_SESSION_TOKEN=your_session_token_here
32+
# HYTALE_SERVER_3_IDENTITY_TOKEN=your_identity_token_here
33+
# HYTALE_SERVER_3_OWNER_UUID=your_owner_uuid_here

docker-compose.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
services:
2+
hytale-server:
3+
build: .
4+
image: hytale-server:latest
5+
container_name: hytale-server
6+
ports:
7+
# Default Hytale server port
8+
- "5520:5520"
9+
environment:
10+
# Required: Authentication tokens from Hytale server dashboard
11+
- HYTALE_SERVER_SESSION_TOKEN=${HYTALE_SERVER_SESSION_TOKEN}
12+
- HYTALE_SERVER_IDENTITY_TOKEN=${HYTALE_SERVER_IDENTITY_TOKEN}
13+
- HYTALE_SERVER_OWNER_UUID=${HYTALE_SERVER_OWNER_UUID}
14+
env_file:
15+
# Load environment variables from .env file
16+
- .env
17+
volumes:
18+
# Server data (downloaded files, server jar, assets)
19+
- hytale-data:/app
20+
# Optional: Mount local config directory for easier access
21+
# - ./config:/app/config
22+
# Optional: Mount local worlds directory for backup/restore
23+
# - ./worlds:/app/worlds
24+
# Optional: Mount local logs directory
25+
# - ./logs:/app/logs
26+
restart: unless-stopped
27+
stdin_open: true
28+
tty: true
29+
# Optional: Resource limits
30+
# deploy:
31+
# resources:
32+
# limits:
33+
# memory: 4G
34+
# reservations:
35+
# memory: 1G
36+
37+
# ============================================================
38+
# MULTIPLE SERVER INSTANCES EXAMPLE
39+
# Uncomment and configure the services below to run multiple
40+
# Hytale server instances on the same host.
41+
# Each instance requires its own:
42+
# - Unique container name
43+
# - Unique external port mapping
44+
# - Separate data volume
45+
# - Own set of authentication tokens
46+
# ============================================================
47+
48+
# hytale-server-2:
49+
# build: .
50+
# image: hytale-server:latest
51+
# container_name: hytale-server-2
52+
# ports:
53+
# - "5521:5520"
54+
# environment:
55+
# - HYTALE_SERVER_SESSION_TOKEN=${HYTALE_SERVER_2_SESSION_TOKEN}
56+
# - HYTALE_SERVER_IDENTITY_TOKEN=${HYTALE_SERVER_2_IDENTITY_TOKEN}
57+
# - HYTALE_SERVER_OWNER_UUID=${HYTALE_SERVER_2_OWNER_UUID}
58+
# env_file:
59+
# - .env
60+
# volumes:
61+
# - hytale-data-2:/app
62+
# restart: unless-stopped
63+
# stdin_open: true
64+
# tty: true
65+
66+
# hytale-server-3:
67+
# build: .
68+
# image: hytale-server:latest
69+
# container_name: hytale-server-3
70+
# ports:
71+
# - "5522:5520"
72+
# environment:
73+
# - HYTALE_SERVER_SESSION_TOKEN=${HYTALE_SERVER_3_SESSION_TOKEN}
74+
# - HYTALE_SERVER_IDENTITY_TOKEN=${HYTALE_SERVER_3_IDENTITY_TOKEN}
75+
# - HYTALE_SERVER_OWNER_UUID=${HYTALE_SERVER_3_OWNER_UUID}
76+
# env_file:
77+
# - .env
78+
# volumes:
79+
# - hytale-data-3:/app
80+
# restart: unless-stopped
81+
# stdin_open: true
82+
# tty: true
83+
84+
volumes:
85+
hytale-data:
86+
name: hytale-server-data
87+
# Optional: Use local driver with specific path
88+
# driver: local
89+
# driver_opts:
90+
# type: none
91+
# o: bind
92+
# device: /path/to/your/data
93+
94+
# Additional volumes for multiple instances
95+
# hytale-data-2:
96+
# name: hytale-server-2-data
97+
# hytale-data-3:
98+
# name: hytale-server-3-data

0 commit comments

Comments
 (0)