Skip to content

Commit 0fe5b44

Browse files
committed
feat: satisfactory support
fix coalesce error
1 parent 3751dad commit 0fe5b44

File tree

4 files changed

+69
-13
lines changed

4 files changed

+69
-13
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ https://github.com/user-attachments/assets/e2e63d59-3a4e-4aaa-8513-30243aafa6c4
5858
- Minecraft (via [itzg/docker-minecraft-server](https://github.com/itzg/docker-minecraft-server))
5959
- Terraria (via [ryshe/terraria](https://hub.docker.com/r/ryshe/terraria))
6060
- Factorio (via [factoriotools/factorio](https://hub.docker.com/r/factoriotools/factorio))
61+
- Satisfactory (via [wolveix/satisfactory-server](https://hub.docker.com/r/wolveix/satisfactory-server))
6162

6263
**LinuxGSM**
6364

@@ -119,9 +120,10 @@ Minecraft:
119120

120121
Assuming one server and AWS free tier/offers:
121122

122-
- Minecraft: **<=0.7 USD for 30h of gameplay per month** using 1x 2.7GHz vCPU and 8GB DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=dc1445d2100ca6e1e362c332bc2f88ee2b600104))
123-
- Terraria: **<=0.7 USD for 30h of gameplay per month** using 1x 3.7 GHz vCPU and 4GB of DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=f63634222b52545ef1230d16f4f21500cae14ff0))
124-
- Factorio: **<=0.7 USD for 30h of gameplay per month** using 1x 3.7 GHz vCPU and 4GB of DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=ff82441ec0eea51961558a2d6a5424d1422599cc))
123+
- Minecraft: **<0.7 USD for 30h of gameplay per month** using 1x 2.7GHz vCPU and 8GB DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=dc1445d2100ca6e1e362c332bc2f88ee2b600104))
124+
- Terraria: **<0.5 USD for 30h of gameplay per month** using 1x 3.7 GHz vCPU and 4GB of DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=f63634222b52545ef1230d16f4f21500cae14ff0))
125+
- Factorio: **<0.7 USD for 30h of gameplay per month** using 1x 3.7 GHz vCPU and 4GB of DDR5 RAM ([estimate](https://calculator.aws/#/estimate?id=ff82441ec0eea51961558a2d6a5424d1422599cc))
126+
- Satisfactory: **<0.9 USD for 30h of gameplay per month** using 1x 3.7 GHz vCPU and 8GB of DDR5 RAM ([estimate]())
125127

126128
AWS Pricing Calculator estimates do not include Public IP cost, see tables below.
127129

@@ -151,12 +153,12 @@ Again, these are just estimates.
151153

152154
| 12FT | AF | Service | Sub-service / description | Price/hour | Price 30h/mo | Price 30h/mo w/ free tier/offers | Price 0h/mo (not in use, no free tier/offers) |
153155
| ---- | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------ | -------------------------------- | --------------------------------------------- |
154-
| | | EC2 | [`m7a.medium`](https://instances.vantage.sh/aws/ec2/m7a.medium?min_memory=4&min_vcpus=1&region=us-east-2&cost_duration=daily&selected=m7a.medium&os=linux&reserved_term=Standard.noUpfront) **spot** instance | $0.021 | $0.63 | $0.63 | |
156+
| | | EC2 | [`m8g.medium`](https://instances.vantage.sh/aws/ec2/m7a.medium?min_memory=4&min_vcpus=1&region=us-east-2&cost_duration=daily&selected=m7a.medium&os=linux&reserved_term=Standard.noUpfront) **spot** instance | $0.015 | $0.45 | $0.45 | |
155157
| ☑️ | | EBS | 4GB root volume + 1GB game data volume | - | ~$0.4 | - | ~$0.4 |
156158
| ☑️ | | EBS | (Optional) Snapshots of 1GB game data volume | - | ~$0.05 | | ~$0.05 |
157159
| ☑️ | | VPC | [Public IPv4 address](https://aws.amazon.com/pt/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/) | $0.005 | $0.15 | - | |
158160
| || VPC | ~10GB of outbound network data (example) | $0.003 | $0.9 | - | |
159-
| | | | **Total** | $0.12 | **$2.13** | **$0.63** | **$0.45** |
161+
| | | | **Total** | $0.12 | **$1.95** | **$0.45** | **$0.45** |
160162

161163
</details>
162164

@@ -174,6 +176,20 @@ Again, these are just estimates.
174176

175177
</details>
176178

179+
<details>
180+
<summary><b>Satisfactory</b></summary>
181+
182+
| 12FT | AF | Service | Sub-service / description | Price/hour | Price 30h/mo | Price 30h/mo w/ free tier/offers | Price 0h/mo (not in use, no free tier/offers) |
183+
| ---- | --- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------ | -------------------------------- | --------------------------------------------- |
184+
| | | EC2 | [`r7a.medium`](https://instances.vantage.sh/aws/ec2/r7a.medium?min_memory=8&min_vcpus=1&region=us-east-2&cost_duration=daily&selected=r7a.medium&os=linux&reserved_term=Standard.noUpfront) **spot** instance | $0.028 | $0.84 | $0.84 | |
185+
| ☑️ | | EBS | 4GB root volume + 6GB game data volume | - | ~$0.8 | - | ~$0.48 |
186+
| | | EBS | (Optional) Snapshots of 6GB game data volume | - | ~$0.3 | | ~$0.3 |
187+
| ☑️ | | VPC | [Public IPv4 address](https://aws.amazon.com/pt/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/) | $0.005 | $0.15 | - | |
188+
| || VPC | ~10GB of outbound network data (example) | $0.003 | $0.9 | - | |
189+
| | | | **Total** | $0.12 | **$2.99** | **$0.84** | **$0.78** |
190+
191+
</details>
192+
177193
### Things to keep in mind
178194

179195
- Last updated: October 2024 (please check the AWS Pricing Calculator estimates)

server/ebs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_ebs_volume" "server_data" {
88

99
snapshot_id = var.snapshot_id
1010

11-
final_snapshot = true
11+
final_snapshot = var.data_volume_final_snapshot
1212

1313
tags = {
1414
Name = "${local.prefix_id_game} Data Volume"

server/main.tf

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ locals {
2727
}
2828
terraria = {
2929
game_name = "Terraria"
30-
instance_type = coalesce(var.instance_type, "m7a.medium")
31-
arch = coalesce(var.arch, "x86_64")
30+
instance_type = coalesce(var.instance_type, "m8g.medium")
31+
arch = coalesce(var.arch, "arm64")
3232
data_volume_size = coalesce(var.data_volume_size, 1)
3333
compose_main_service_name = "terraria"
3434
main_port = coalesce(var.main_port, 7777)
@@ -43,6 +43,15 @@ locals {
4343
main_port = coalesce(var.main_port, 34197)
4444
watch_connections = coalesce(var.watch_connections, true)
4545
}
46+
satisfactory = {
47+
game_name = "Satisfactory"
48+
instance_type = coalesce(var.instance_type, "r7a.medium")
49+
arch = coalesce(var.arch, "x86_64")
50+
data_volume_size = coalesce(var.data_volume_size, 6)
51+
compose_main_service_name = "satisfactory"
52+
main_port = coalesce(var.main_port, 7777)
53+
watch_connections = coalesce(var.watch_connections, true)
54+
}
4655
linuxgsm = {
4756
game_name = "LinuxGSM"
4857
instance_type = var.instance_type
@@ -136,13 +145,38 @@ locals {
136145
stop_grace_period : "1m"
137146
}
138147

148+
satisfactory = {
149+
container_name : "satisfactory",
150+
image : "wolveix/satisfactory-server",
151+
ports : coalesce(var.compose_game_ports, ["7777:7777/tcp", "7777:7777/udp"]),
152+
environment : merge({
153+
"MAXPLAYERS" : 4
154+
"PGID" : 1000
155+
"PUID" : 1000
156+
"ROOTLESS" : false
157+
"STEAMBETA" : false
158+
}, var.compose_game_environment)
159+
healthcheck : {
160+
test : ["CMD", "bash", "/healthcheck.sh"]
161+
interval : "30s"
162+
timeout : "10s"
163+
retries : 3
164+
start_period : "120s"
165+
}
166+
volumes : [
167+
"${local.data_subfolder_path}:/config",
168+
]
169+
restart : "no"
170+
stop_grace_period : "1m"
171+
}
172+
139173
linuxgsm = {
140174
container_name : coalesce(var.linuxgsm_game_shortname, "invalid")
141175
image : "gameservermanagers/gameserver:${coalesce(var.linuxgsm_game_shortname, "invalid")}"
142176
ports : concat([
143-
"${var.main_port}:${var.main_port}/tcp",
144-
"${var.main_port}:${var.main_port}/udp"
145-
], var.compose_game_ports)
177+
"${local.game.main_port}:${local.game.main_port}/tcp",
178+
"${local.game.main_port}:${local.game.main_port}/udp"
179+
], coalesce(var.compose_game_ports, []))
146180
environment : merge({}, var.compose_game_environment)
147181
volumes : [
148182
"${local.data_subfolder_path}:/data",

server/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ variable "game" {
1616
type = string
1717

1818
validation {
19-
condition = contains(["minecraft", "terraria", "factorio", "linuxgsm", "custom"], var.game)
20-
error_message = "Valid values are: minecraft, terraria, factorio, linuxgsm, custom"
19+
condition = contains(["minecraft", "terraria", "factorio", "satisfactory", "linuxgsm", "custom"], var.game)
20+
error_message = "Valid values are: minecraft, terraria, factorio, satisfactory, linuxgsm, custom"
2121
}
2222
}
2323

@@ -101,6 +101,12 @@ variable "data_volume_size" {
101101
}
102102
}
103103

104+
variable "data_volume_final_snapshot" {
105+
description = "Create final snapshot when destroying data volume"
106+
type = bool
107+
default = true
108+
}
109+
104110
variable "snapshot_id" {
105111
description = "The snapshot ID to use as the base of the data volume. Can be used to restore backups"
106112
type = string

0 commit comments

Comments
 (0)