From 4c56c8429669f8e7e8120f949f34cc376097559d Mon Sep 17 00:00:00 2001 From: William Miceli Date: Fri, 23 Feb 2024 18:19:37 -0500 Subject: [PATCH] Using `/persistent` now for persistent data volume; changed image tags slightly --- .drone.yml | 12 ++++++------ Dockerfile | 11 ++++++++--- README.md | 15 ++++++++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.drone.yml b/.drone.yml index def4022..4b8520d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -55,9 +55,9 @@ steps: - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}; fi - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}; fi - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}.${DRONE_SEMVER_PATCH}; fi - - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:app_build_id$${APP_BUILD_ID} - - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:ci_build${DRONE_BUILD_NUMBER} - - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:commit_sha${DRONE_COMMIT_SHA:0:12} + - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:app_build_id-$${APP_BUILD_ID} + - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:ci_build-${DRONE_BUILD_NUMBER} + - docker image tag image:latest git.williammiceli.systems/william/docker_satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12} - docker image push --all-tags git.williammiceli.systems/william/docker_satisfactory-server depends_on: - build @@ -82,9 +82,9 @@ steps: - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}; fi - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}; fi - if [ -n "$DRONE_SEMVER" ]; then docker image tag image:latest docker.io/williammiceli/satisfactory-server:${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}.${DRONE_SEMVER_PATCH}; fi - - docker image tag image:latest docker.io/williammiceli/satisfactory-server:app_build_id$${APP_BUILD_ID} - - docker image tag image:latest docker.io/williammiceli/satisfactory-server:ci_build${DRONE_BUILD_NUMBER} - - docker image tag image:latest docker.io/williammiceli/satisfactory-server:commit_sha${DRONE_COMMIT_SHA:0:12} + - docker image tag image:latest docker.io/williammiceli/satisfactory-server:app_build_id-$${APP_BUILD_ID} + - docker image tag image:latest docker.io/williammiceli/satisfactory-server:ci_build-${DRONE_BUILD_NUMBER} + - docker image tag image:latest docker.io/williammiceli/satisfactory-server:commit_sha-${DRONE_COMMIT_SHA:0:12} - docker image push --all-tags docker.io/williammiceli/satisfactory-server depends_on: - build diff --git a/Dockerfile b/Dockerfile index e117130..1df9a81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,11 @@ ENV LANGUAGE 'en_US:en' # Create user for SteamCMD RUN useradd -m steam +# Setup Directory for Persistent Data +RUN mkdir -p /home/steam/.config/Epic/FactoryGame/Saved/SaveGames /persistent && \ + ln -s /persistent /home/steam/.config/Epic/FactoryGame/Saved/SaveGames && \ + chown -R steam /persistent + # Switch to Steam user USER steam WORKDIR /home/steam @@ -38,7 +43,7 @@ RUN steamcmd +force_install_dir /home/steam/satisfactory_server +login anonymous EXPOSE 7777/udp 15000/udp 15777/udp # Persistent data volume for the server -VOLUME ["/home/steam/.config/Epic/FactoryGame/Saved"] +VOLUME ["/persistent"] # Start command for the server CMD ["/home/steam/satisfactory_server/FactoryServer.sh"] @@ -46,5 +51,5 @@ CMD ["/home/steam/satisfactory_server/FactoryServer.sh"] # Labels LABEL org.opencontainers.image.authors="William Miceli; https://github.com/WilliamMiceli; https://williammiceli.me" LABEL org.opencontainers.image.source=https://github.com/WilliamMiceli/Docker_Satisfactory-Server -LABEL org.opencontainers.image.revision=${DRONE_COMMIT_SHA} -LABEL org.opencontainers.image.created=${DRONE_BUILD_STARTED} +LABEL org.opencontainers.image.revision=$${DRONE_COMMIT_SHA} +LABEL org.opencontainers.image.created=$${DRONE_BUILD_STARTED} diff --git a/README.md b/README.md index 5acf3f9..516380e 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,19 @@ # Usage -## Public Image Repository - -[Docker Hub](https://hub.docker.com/r/williammiceli/satisfactory-server) +## Available Tags +- [`latest`](https://hub.docker.com/r/williammiceli/satisfactory-server/tags?name=latest) +- [`app_build_id-`](https://hub.docker.com/r/williammiceli/satisfactory-server/tags?name=app_build_id) +- [`ci_build-`](https://hub.docker.com/r/williammiceli/satisfactory-server/tags?name=ci_build) +- [`commit_sha-`](https://hub.docker.com/r/williammiceli/satisfactory-server/tags?name=commit_sha) ## Running This Image ### One-line (Useful for Testing) ```sh -docker run -d -p 7777:7777/udp -p 15000:15000/udp -p 15777:15777/udp -v /path/to/your/data:/home/steam/.config/Epic/FactoryGame/Saved williammiceli/satisfactory-server:latest +docker run -d -p 7777:7777/udp -p 15000:15000/udp -p 15777:15777/udp -v /path/to/your/data:/persistent williammiceli/satisfactory-server:latest ``` ### Docker Compose @@ -43,7 +45,7 @@ services: volumes: - type: bind source: ./data # Path to your local directory for server data - target: /home/steam/.config/Epic/FactoryGame/Saved + target: /persistent restart: unless-stopped ``` @@ -70,19 +72,18 @@ docker compose down ```sh docker image pull williammiceli/satisfactory-server:latest ``` - ### Use SteamCMD In Running Container ```sh steamcmd +force_install_dir /home/steam/satisfactory_server +login anonymous +app_update 1690800 -beta public validate +quit ``` - ![Player Thumbs Up](https://img2.storyblok.com/fit-in/0x800/filters:format(png)/f/110098/600x730/99e92fe34f/hero-graphic.png) # Meta +* [Docker Hub](https://hub.docker.com/r/williammiceli/satisfactory-server) * [Build System](https://drone.williammiceli.systems/William/Docker_Satisfactory-Server) ## Credits for Useful References