Didstopia / starbound-server

Provides a dedicated linux server for Starbound running inside a Docker container.
29 stars 12 forks source link

How do you edit starbound_server.config? #7

Open woeisme opened 2 years ago

woeisme commented 2 years ago

The container image seems to overwrite starbound_server.config at each restart, how do we edit the file but retain changes on restarts?

Dids commented 2 years ago

Did you set up persistence with the two volumes or bind mounts as seen here? https://github.com/Didstopia/starbound-server/blob/master/docker-compose.yaml

woeisme commented 2 years ago

I started with the default two volumes in my docker-compose.yaml

Previous to this I was having to shell into the container via docker exec -it starbound bash and hand modifying starbound-server.config.

Last night I ran docker restart starbound after added another player and it reset the config back to default template.

What's the preferred method for modifying starbound_server.config and retaining those changes between restarts?

Eventually I'd like to switch this setup to bind mounts as that would help with being able to modify files even when the container is stopped. I'll attach my docker-compose.yaml below :

services:
  starbound-server:
    image: didstopia/starbound-server:latest
    container_name: starbound
    build:
      context: .
      dockerfile: Dockerfile
    env_file: .env
    stdin_open: true # docker run -i
    tty: true        # docker run -t
    ports:
      - "21025:21025/tcp"
    volumes:
      - starbound-data:/steamcmd/starbound
      - starbound-steam:/app/.steam:cached
    restart: unless-stopped
#    volumes:
#      - /data/starbound/steamcmd/starbound:/starbound-data
#      - /data/starbound/app/.steam:/starbound-steam
#    volumes:
#      - /home/BLANKED/starbound-server/starbound-data:/steamcmd/starbound:cached
#      - /home/BLANKED/starbound-server/starbound-steam:/app/.steam:cached
volumes:
  starbound-data:
  starbound-steam:
woeisme commented 2 years ago

Managed to restore my server instance, still new at this whole docker thing but it seems like running docker restart seemed to have overwritten the file from default install template.

I'd still like to know the preferred method for editing this file while concretely retaining changes.

I think eventually I'll need to explore migrating the data and app dir to a bind mount container image, instead of the volumes currently in use.