feat: Added Blender template

This commit is contained in:
vishalkadam47
2024-10-18 04:55:37 +05:30
parent 15a76d2639
commit e52a0fc9d4
4 changed files with 238 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
version: "3.8"
services:
blender:
image: lscr.io/linuxserver/blender:latest
privileged: true
container_name: blender
security_opt:
- seccomp:unconfined #optional
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- compute
- video
- graphics
- utility
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- SUBFOLDER=/ #optional
volumes:
- blender:/config
ports:
- 3000:3000
- 3001:3001
restart: unless-stopped
shm_size: 1gb
volumes:
blender: null

View File

@@ -0,0 +1,34 @@
import {
generateHash,
generateRandomDomain,
type Template,
type Schema,
type DomainSchema,
} from "../utils";
export function generate(schema: Schema): Template {
const mainServiceHash = generateHash(schema.projectName);
const mainDomain = generateRandomDomain(schema);
const domains: DomainSchema[] = [
{
host: mainDomain,
port: 3000,
serviceName: "blender",
},
];
const envs = [
`PUID=1000`,
`PGID=1000`,
`TZ=Etc/UTC`,
`SUBFOLDER=/`,
`NVIDIA_VISIBLE_DEVICES=all`,
`NVIDIA_DRIVER_CAPABILITIES=all`,
];
return {
envs,
domains,
};
}