LogicReinc / LogicReinc.BlendFarm

A stand-alone Blender Network Renderer
GNU General Public License v3.0
412 stars 35 forks source link

Create a docker container #75

Open draco1544 opened 1 year ago

draco1544 commented 1 year ago

Hi ! That would be great if your software (render node) as a docker container.

lyze237 commented 8 months ago

Here's a hacked together dockerfile if you want it:

FROM lscr.io/linuxserver/blender:latest

EXPOSE 15000

RUN mkdir /blendfarm
WORKDIR /blendfarm
RUN apt update ; apt install unzip wget -y
RUN wget "https://github.com/LogicReinc/LogicReinc.BlendFarm/releases/download/v1.1.5/BlendFarm.Server-1.1.5-Linux64.zip"
RUN unzip "BlendFarm.Server-1.1.5-Linux64.zip"
RUN chmod u+x "BlendFarm.Server-1.1.5-Linux64/LogicReinc.BlendFarm.Server"
RUN chmod u+x "BlendFarm.Server-1.1.5-Linux64"
RUN chmod u+r "BlendFarm.Server-1.1.5-Linux64"
RUN chmod u+w "BlendFarm.Server-1.1.5-Linux64"
WORKDIR "/blendfarm"

CMD "BlendFarm.Server-1.1.5-Linux64/LogicReinc.BlendFarm.Server"

And I run it with docker-compose:

version: "3.9"
services:
  blender:
    cpus: "8"
    image: blendfarm
    build:
      context: ./build/
    container_name: blendfarm
    runtime: nvidia
    volumes:
      - /mnt/user/appdata/BlendFarm/Data:/blendfarm/BlenderData
      - /mnt/user/appdata/BlendFarm/Files:/blendfarm/BlenderFiles
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - NVIDIA_VISIBLE_DEVICES=all
    restart: unless-stopped
    ports:
      - 15000:15000
nirurin commented 4 months ago

Sorry to be a newbie, I have looked into this and seen some guides on using dockerfile, but they don't seem to use docker-compose (and I do prefer using compose), so I'm not sure where the dockerfile should go relative to the compose file? The compose file doesn't seem to have a directory-path to find and build the dockerfile....

I have a folder called 'docker' which has all my container folders (so I would have one called blendfarm), and the docker-compose for blendfarm would be in the blendfarm folder. Would this dockerfile also go in the same folder?

lyze237 commented 4 months ago

context: ./build/ tells compose where the Dockerfile is located relative to the compose file:

docker/blendfarm/docker-compose.yml docker/blendfarm/build/Dockerfile

nirurin commented 4 months ago

Ahhh I see, tired brain didn't notice the ./ haha. Thankyou, I'm in the process of upgrading my NAS to something that will actually have a gpu (only a low profile one, but still) and was curious if it might help render a frame or two. Something to tinker with!