factorio-server-manager/docker
2022-02-27 22:32:32 +01:00
..
.dockerignore New docker bundle 2020-09-20 21:41:13 +03:00
.env generate RCON password, if default or not set 2021-01-14 20:24:09 +01:00
.gitignore New docker bundle 2020-09-20 21:41:13 +03:00
build-release.sh Fix Dockerfile-build for Windows cross compilation 2021-01-25 12:50:08 -05:00
build.sh changed from mroote to OFSM 2020-12-25 17:23:36 +01:00
docker-compose.simple.yaml Fixed wrong change of PR #303 2022-02-27 22:32:32 +01:00
docker-compose.yaml Update docker-compose.yaml 2022-01-24 11:26:40 +08:00
Dockerfile Corrected xz package in Dockerfile 2022-02-01 15:22:03 +01:00
Dockerfile-build Fix Dockerfile-build for Windows cross compilation 2021-01-25 12:50:08 -05:00
Dockerfile-local Update Dockerfile-local 2022-01-24 11:24:02 +08:00
entrypoint.sh generate RCON password, if default or not set 2021-01-14 20:24:09 +01:00
README.md Add hint to generated password 2021-05-22 16:17:52 +02:00

Factorio Server Manager Docker Image

Prerequisites

You need to have Docker and Docker Compose installed.

Getting started?

Copy docker-compose.yaml and .env files from this repository to somewhere on your server.

Edit values in the .env file:

  • RCON_PASS (default empty string): Password for Factorio RCON (FSM uses it to communicate with the Factorio server).
    If left empty, a random password will be generated and saved on the first start of the server. You can see the password in fsm-data/conf.json file.
  • DOMAIN_NAME (must be set manually): The domain name where your FSM UI will be available. Must be set, so Let's Encrypt service can issue a valid HTTPS certificate for this domain.
  • EMAIL_ADDRESS (must be set manually): Your email address. Used only by Let's Encrypt service.

Alternatively you can ignore .env file and edit this values directly in environment section of docker-compose.yaml. But remember that if .env file is present, values set there take precedence over values set in docker-compose.yaml.

Now you can start the container by running:

docker-compose up -d

Simple configuration without HTTPS

If you don't care about HTTPS and want to run just the Factorio Server Manager, or want to run it on a local machine you can use docker-compose.simple.yaml.

Ignore DOMAIN_NAME and EMAIL_ADDREESS variables in .env file and run

docker-compose -f docker-compose.simple.yaml up -d

Factorio version

By default container will download the latest version of factorio. If you want to use specific version, you can change the value of FACTORIO_VERSION=latest variable in the docker-compose.yaml file. Any version can be used. Using latest will download the newest beta version. Using stable will download the newest stable version.

Accessing the application

Go to the domain specified in your .env file in your web browser. If running on localhost access the application at http://localhost

First start

When container starts it begins to download Factorio headless server archive, and only after that Factorio Server Manager server starts. So when docker-compose writes

Creating factorio-server-manager ... done

you have to wait several seconds before FSM UI becomes available.

It may take some time for Let's Encrypt to issue the certificate, so for the first couple of minutes after starting the container you may see "Your connection is not private" error when you open your Factorio Server Manager address in your browser. This error should disappear within a couple of minutes, if configuration parameters are set correctly.

Updating Credentials, adding and deleting users.

An admin user is created initially using the credentials defined in the factorio-server-manager config file. When you haven't specified one, a random password will be logged in the container output (docker logs factorio-server-manager).

Users can be added and deleted on the settings page.

Updating Factorio

For now, you can't update/downgrade the Factorio version from the UI.

You can however do this using docker images while sustaining your security settings and map/modfiles.

If you want to update Factorio to the latest version:

  1. Save your game and stop Factorio server in FSM UI.
  2. Run docker-compose restart (or docker-compose -f docker-compose.simple.yaml restart if you are using simple configuration).

After container starts, latest Factorio version will be downloaded and installed.

Security

Authentication is supported in the application, but it is recommended to ensure access to the Factorio manager UI is accessible via VPN or internal network.

Development

For development purposes it also has the ability to create the docker image from local sourcecode. This is done by running build.sh in the docker directory. This will delete all old executables and the node_modules directory (runs make build). The created docker image will have the tag factorio-server-manager:dev.

Creating release bundles

A Dockerfile-build file is included for creating the release bundles. Use Docker version 20 in order to use the BUILDKIT environment, some issues have been encountered with Docker version 19.

To create the bundle build the Dockerfile-build file with the following command. The release bundles are output to the ./dist directory.

Run this command from the root factorio-server-manager directory.

DOCKER_BUILDKIT=1 docker build --no-cache -f docker/Dockerfile-build -t ofsm-build --target=build -o dist .

For everyone who actually read this thing to the end

And now go and build some nice factories!