Giter Club home page Giter Club logo

docker-mednafen-server's Introduction

docker-mednafen-server logo

A Docker image for the Mednafen standalone server based on the official Alpine Linux image.
Mednafen-Server allows you to play many emulator games online via netplay using the Mednafen multi-system emulator.


Docker Tag Version Description Platform
latest 1.1 Latest stable release amd64, arm64

Environment variablesPassword protectionUsageUsing ComposeManual buildLicense


Environment variables

A few environment variables can be tweaked when creating a container to define the server configuration:

Click to expand
Variable Default value Description
MDFNSV_MAXCLIENTS 50 Maximum number of clients.
MDFNSV_CONNECTTIMEOUT 5 Connection (login) timeout (in seconds).
MDFNSV_PORT 4046 Port to listen on (TCP).
MDFNSV_IDLETIMEOUT 30 Idle timeout (in seconds). Disconnect a client if no data is received from them since X seconds ago.
MDFNSV_MAXCMDPAYLOAD 5242880 The maximum data (in bytes) in the payload of a command to be received by the server (including save state transfers).
MDFNSV_MINSENDQSIZE 262144 Soft send queue start size (in bytes), and minimum size (memory allocated) it will shrink to.
MDFNSV_MAXSENDQSIZE 8388608 Maximum size (in bytes) each internal per-client soft send queue is allowed to grow to. The client is dropped on overflowing this size.
MDFNSV_PASSWORD Server password (NOT recommended, see the section below).
MDFNSV_ISPUBLIC 0 Make the server public. Ignore the password environment variable (if set) and remove any existing password from the configuration file.

Descriptions mostly taken from the original standard.conf file in the Mednafen-Server sources.

Password protection

The server can be protected with a (clear, unencrypted) password and defined in various ways:

— Bind mount a text file containing the password into the container.
The mountpoint path has to be /run/secrets/mednafenserver.
This is the recommended method. See the second example in the section below.

— Using the MDFNSV_PASSWORD environment variable when creating the container.
This method is NOT recommended for production since all environment variables are visible via docker inspect to any user that can use the docker command.

— By editing the server.conf file located beside the server binary and accessed by mounting a volume on /home/mednafen.

Usage

Example 1:
Run a public server on port 40451 with a maximum of 4 clients and a connection time out of 15 seconds:
The ulimit option is optional but highly recommended for the server to run properly.

docker run -d \
  --name mednafen-server \
  --ulimit memlock=-1 \
  -p 40451:40451/tcp \
  -e MDFNSV_MAXCLIENTS=4 \
  -e MDFNSV_CONNECTTIMEOUT=15 \
  -e MDFNSV_PORT=40451 \
  -e MDFNSV_ISPUBLIC=1 \
  -i k4rian/mednafen-server:latest

Example 2:
Run a password-protected server using default configuration:
In this example, the password is stored in the secret.txt file located in the current working directory.

docker run -d \
  --name mednafen-server \
  --ulimit memlock=-1 \
  -p 4046:4046/tcp \
  -v "$(pwd)"/secret.txt:/run/secrets/mednafenserver:ro \
  -i k4rian/mednafen-server:latest

Example 3:
Run a password-protected testing server on port 4444:

docker run -d \
  --name mednafen-server-test \
  --ulimit memlock=-1 \
  -p 4444:4444/tcp \
  -e MDFNSV_PORT=4444 \
  -e MDFNSV_PASSWORD="testing" \
  -i k4rian/mednafen-server:latest 

Using Compose

See compose/README.md

Manual build

Requirements:
— Docker >= 18.09.0
— Git (optional)

Like any Docker image the building process is pretty straightforward:

  • Clone (or download) the GitHub repository to an empty folder on your local machine:
git clone https://github.com/K4rian/docker-mednafen-server.git .
  • Then run the following command inside the newly created folder:
docker build --no-cache -t k4rian/mednafen-server .

License

GPL-2.0

docker-mednafen-server's People

Contributors

k4rian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

pmkden jeffabner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.