diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0b1c91 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM debian:stable-slim + +ARG version="v7.5" + +RUN useradd --system folding && \ + mkdir -p /opt/fahclient && \ + # download and untar + apt-get update -y && \ + apt-get install -y wget bzip2 && \ + wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/${version}/latest.tar.bz2 -O /tmp/fahclient.tar.bz2 && \ + tar -xjf /tmp/fahclient.tar.bz2 -C /opt/fahclient --strip-components=1 && \ + # fix permissions + chown -R folding:folding /opt/fahclient && \ + # cleanup + rm -rf /tmp/fahclient.tar.bz2 && \ + apt-get purge -y wget bzip2 && \ + apt-get clean autoclean && \ + apt-get autoremove --yes && \ + rm -rf /var/lib/apt/lists/* + +COPY entrypoint.sh /opt/fahclient + +ENV USER "Anonymous" +ENV TEAM "0" +ENV ENABLE_GPU "false" +ENV ENABLE_SMP "true" + +USER folding +WORKDIR /opt/fahclient + +EXPOSE 7396 +EXPOSE 36330 + +ENTRYPOINT ["/opt/fahclient/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d9556a --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +# Folding@Home Docker + +Folding@home is a project focused on disease research. The problems we’re solving require so many computer calcul­ations – and we need your help to find the cures! + +## Usage + +### docker + +``` +docker run \ + --name folding-at-home \ + -p 7396:7396 \ + -p 36330:36330 \ + -e USER=Anonymous \ + -e TEAM=0 \ + -e ENABLE_GPU=false \ + -e ENABLE_SMP=true \ + --restart unless-stopped \ + yurinnick/folding-at-home +``` + +### docker-compose + +``` +--- +version: "3" +services: + folding-at-home: + image: yurinnick/folding-at-home + container_name: folding-at-home + environment: + - USER=Anonymous + - TEAM=0 + - ENABLE_GPU=false + - ENABLE_SMP=true + ports: + - 7396:7396 + - 36330:36330 + restart: unless-stopped +``` + +### Kubernetes + +``` +TDB +``` + +## Parameters + +- USER - Folding@home username (default: Anonymous) +- TEAM - Foldinghome team number (default: 0) +- PASSKEY - [optional] Folding@home [passkey](https://apps.foldingathome.org/getpasskey) +- ENABLE_GPU - Enable GPU compute (default: false) +- ENABLE_SMP - Enable auto-configuration of SMP slots (default: true) + +Additional configuration parameters can be passed as command line arguments. To get the full list of parameters run: + +``` +docker run yurinnick/folding-at-home:latest --help +``` + +## Web Interface + +Web interface is locked to `localhost` by default, to enable remote access run: + +``` +docker run \ + --name folding-at-home \ + -p 7396:7396 \ + -p 36330:36330 \ + -e USER=Anonymous \ + -e TEAM=0 \ + -e ENABLE_GPU=false \ + -e ENABLE_SMP=true \ + --restart unless-stopped \ + yurinnick/folding-at-home \ + --allow 0/0 \ + --web-allow 0/0 +``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4498eba --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,15 @@ +--- +version: "3" +services: + folding-at-home: + image: yurinnick/folding-at-home + container_name: folding-at-home + environment: + - USER=Anonymous + - TEAM=0 + - ENABLE_GPU=false + - ENABLE_SMP=true + ports: + - 7396:7396 + - 36330:36330 + restart: unless-stopped diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..c98ba75 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +/opt/fahclient/FAHClient \ + --user=${USER} \ + --team=${TEAM} \ + --passkey=${PASSKEY} \ + --gpu=${ENABLE_GPU} \ + --smp=${ENABLE_SMP} \ + --power=full \ + --gui-enabled=false \ + ${@}