Created separate devcontainers (non-headless, headless). Replaced devcontainers image with dotnet SDK image. Minor fixes.

This commit is contained in:
Tarantino, Roberto 2025-12-24 18:51:03 +01:00
parent ffa0e97545
commit e1347fa73f
5 changed files with 141 additions and 56 deletions

View file

@ -1,53 +0,0 @@
FROM node:20-slim AS web-builder
ARG JELLYFIN_WEB_BUILD_CONFIG=development
ARG JELLYFIN_WEB_GIT_BRANCH=master
USER root
# Intall build dependencies
RUN apt-get update && apt-get install git -y
# Clone the repository at the specified branch/tag/commit
RUN git clone --branch $JELLYFIN_WEB_GIT_BRANCH https://github.com/jellyfin/jellyfin-web.git /root/jellyfin-web
WORKDIR /root/jellyfin-web
# Install dependencies and build
RUN npm i && npm run build:$JELLYFIN_WEB_BUILD_CONFIG
FROM mcr.microsoft.com/devcontainers/dotnet:9.0-bookworm AS debug
USER root
# Import Jellyfin public GPG key
RUN curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
# Create Jellyfin source file
RUN . /etc/os-release && ARCH=$(dpkg --print-architecture) && \
tee /etc/apt/sources.list.d/jellyfin.sources <<EOF
Types: deb
URIs: https://repo.jellyfin.org/$ID
Suites: $VERSION_CODENAME
Components: main
Architectures: $ARCH
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
# Install needed packages
RUN apt-get update && \
apt-get install \
jellyfin-ffmpeg7 \
libfontconfig1 \
-y
# Create symbolic links for ffmpeg tools
RUN ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \
ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe && \
ln -s /usr/lib/jellyfin-ffmpeg/vainfo /usr/local/bin/vainfo
# Copy the statically compiled frontend artifacts
COPY --from=web-builder --chown=root:root --chmod=755 /root/jellyfin-web/dist /srv/jellyfin-web
# Set environment variable needed for serving the frontend
ENV JELLYFIN_WEB_DIR=/srv/jellyfin-web

View file

@ -0,0 +1,42 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS debug
ARG VSCODE_UID=1000
USER root
# Add the dotnet group, set update permissions for /usr/share/dotnet
# and finally add the vscode user with provided UID
RUN groupadd dotnet && \
chown -R root:dotnet /usr/share/dotnet && \
chmod -R g+w /usr/share/dotnet && \
useradd -m -G dotnet -u $VSCODE_UID -s /bin/bash vscode
# Install needed packages
RUN apt-get update && apt-get install -y \
curl \
git \
gnupg2 \
libfontconfig1
# Import Jellyfin public GPG key
RUN curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
# Create Jellyfin source file
RUN . /etc/os-release && ARCH=$(dpkg --print-architecture) && \
tee /etc/apt/sources.list.d/jellyfin.sources <<EOF
Types: deb
URIs: https://repo.jellyfin.org/$ID
Suites: $VERSION_CODENAME
Components: main
Architectures: $ARCH
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
# Install ffmpeg
RUN apt-get update && \
apt-get install -y \
jellyfin-ffmpeg7 \
&& rm -rf /var/lib/apt/lists/*
# Set environment variable needed
ENV JELLYFIN_FFMPEG=/usr/lib/jellyfin-ffmpeg/ffmpeg

View file

@ -0,0 +1,31 @@
{
"name": "Development Jellyfin Headless Server",
"build": {
"dockerfile": "Dockerfile"
},
"containerUser": "vscode",
"mounts": [
"type=bind,src=${localEnv:JELLYFIN_MEDIA_PATH},dst=/media"
],
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"postStartCommand": "dotnet restore && dotnet workload update && dotnet dev-certs https --trust;",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp",
"editorconfig.editorconfig",
"github.vscode-github-actions",
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.csdevkit",
"alexcvzz.vscode-sqlite"
]
}
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"hostRequirements": {
"memory": "8gb",
"cpus": 4
}
}

View file

@ -0,0 +1,68 @@
FROM node:20-slim AS web-builder
# Build configuration for the jellyfin-web repository (development, production)
# For further info: https://github.com/jellyfin/jellyfin-web
ARG JELLYFIN_WEB_BUILD_CONFIG=development
# Branch/tag/commit that will be cloned to build the jellyfin-web repository
ARG JELLYFIN_WEB_GIT_REF=master
USER root
# Install build dependencies
RUN apt-get update && apt-get install git -y
# Clone the repository at the specified branch/tag/commit
RUN git clone --depth 1 --branch $JELLYFIN_WEB_GIT_REF https://github.com/jellyfin/jellyfin-web.git /root/jellyfin-web
WORKDIR /root/jellyfin-web
# Install dependencies and build
RUN npm ci --no-audit && npm run build:$JELLYFIN_WEB_BUILD_CONFIG
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS debug
ARG VSCODE_UID=1000
USER root
# Add the dotnet group, set update permissions for /usr/share/dotnet
# and finally add the vscode user with provided UID
RUN groupadd dotnet && \
chown -R root:dotnet /usr/share/dotnet && \
chmod -R g+w /usr/share/dotnet && \
useradd -m -G dotnet -u $VSCODE_UID -s /bin/bash vscode
# Install needed packages
RUN apt-get update && apt-get install -y \
curl \
git \
gnupg2 \
libfontconfig1
# Import Jellyfin public GPG key
RUN curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
# Create Jellyfin source file
RUN . /etc/os-release && ARCH=$(dpkg --print-architecture) && \
tee /etc/apt/sources.list.d/jellyfin.sources <<EOF
Types: deb
URIs: https://repo.jellyfin.org/$ID
Suites: $VERSION_CODENAME
Components: main
Architectures: $ARCH
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
# Install ffmpeg
RUN apt-get update && \
apt-get install -y \
jellyfin-ffmpeg7 \
&& rm -rf /var/lib/apt/lists/*
# Copy the statically built frontend artifacts
COPY --from=web-builder --chown=root:root --chmod=755 /root/jellyfin-web/dist /jellyfin/jellyfin-web
# Set environment variable needed
ENV JELLYFIN_WEB_DIR=/jellyfin/jellyfin-web \
JELLYFIN_FFMPEG=/usr/lib/jellyfin-ffmpeg/ffmpeg

View file

@ -26,9 +26,6 @@
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"hostRequirements": {