慢慢成长 - 游戏私服
type: channel
link: https://azuoa.com/index.php/category/%E6%B8%B8%E6%88%8F%E7%A7%81%E6%9C%8D/
items: Docker创建SatisFactory服务器镜像和部署服务

Docker创建SatisFactory服务器镜像和部署服务
type: item
date: 2022-06-01T15:31:00+00:00
description: 一. 创建 Dockerfile 文件# 创建文件 touch Dockerfile # 编写 Dockerfile FROM steamcmd/steamcmd:centos-7 MAINTAINER 1302344380@qq.com COPY ./run.sh /run.sh EXPOSE 15777/udp 15000/udp 7777/udp ENTRYPOINT ["/bin/bash", "/run.sh"] 二. 创建 run.sh 文件 # 创建文件 touch run.sh # 编写 run.sh #!/bin/bash # 创建steam账户 useradd steam echo 'add user steam ok' # 创建steam账户密码 echo SatisFactory1 | passwd --stdin steam &> /dev/null echo 'set password: SatisFactory1' # 安装游戏 echo 'start install game' su - steam -c "steamcmd +force_install_dir /home/steam/satisfactory/server +login anonymous +app_update 1690800 -beta public validate +quit" echo 'game install ok' # 运行服务 echo 'start game server' su - steam -c "/home/steam/satisfactory/server/FactoryServer.sh" 三. 打包 Docker 镜像docker build -t satisfactory-server .四. 通过镜像启动容器docker run -d --name satisfactory-server --net=host satisfactory-server五. 查看启动日志# 查看当前日志 docker logs ${容器ID} # 跟踪查看日志 docker logs -f ${容器ID}六. 其他如需上传镜像只镜像仓库, 可以自行查阅相关资料