Added container helper to compose. Updated dockerfile to use bun. Smaller adjustments
This commit is contained in:
@@ -7,4 +7,6 @@ OIDC_AUTHORITY=http://localhost:8092
|
|||||||
OIDC_AUTHORITY=http://localhost:8092
|
OIDC_AUTHORITY=http://localhost:8092
|
||||||
OIDC_CLIENT_ID=client_id
|
OIDC_CLIENT_ID=client_id
|
||||||
OIDC_CLIENT_SECRET=client_secret
|
OIDC_CLIENT_SECRET=client_secret
|
||||||
OIDC_REQUIRE_HTTPS_METADATA=false
|
OIDC_REQUIRE_HTTPS_METADATA=false
|
||||||
|
DOCKER_GID=989
|
||||||
|
DATA_PATH=./data
|
||||||
10
Dockerfile
10
Dockerfile
@@ -4,7 +4,9 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
|
|
||||||
# Install required packages
|
# Install required packages
|
||||||
RUN apt-get update; apt-get install nodejs npm -y; apt-get clean
|
RUN apt-get update; apt-get install unzip -y; apt-get clean
|
||||||
|
RUN curl -fsSL https://bun.sh/install | bash
|
||||||
|
ENV PATH="/root/.bun/bin:${PATH}"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build & publish projects
|
# Build & publish projects
|
||||||
@@ -24,13 +26,13 @@ RUN git clone -b $GIT_BRANCH --single-branch $GIT_REPOSITORY .
|
|||||||
|
|
||||||
# Save hash of commit
|
# Save hash of commit
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
RUN mkdir -p "/output" && git log -1 --pretty=format:"%H" > /output/version
|
RUN mkdir -p "/output" && echo -n $GIT_BRANCH > /output/version
|
||||||
|
|
||||||
# TODO: Implement plugin loading here
|
# TODO: Implement plugin loading here
|
||||||
|
|
||||||
# Install npm packages
|
# Install npm packages
|
||||||
WORKDIR /src/Hosts/Moonlight.Frontend.Host/Styles
|
WORKDIR /src/Hosts/Moonlight.Frontend.Host/Styles
|
||||||
RUN npm install
|
RUN bun install
|
||||||
|
|
||||||
# Install nuget packages
|
# Install nuget packages
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -43,7 +45,7 @@ WORKDIR "/src/Hosts/Moonlight.Frontend.Host"
|
|||||||
RUN dotnet build --no-restore "./Moonlight.Frontend.Host.csproj" -c $BUILD_CONFIGURATION -o /output/build-frontend
|
RUN dotnet build --no-restore "./Moonlight.Frontend.Host.csproj" -c $BUILD_CONFIGURATION -o /output/build-frontend
|
||||||
|
|
||||||
WORKDIR "/src/Hosts/Moonlight.Frontend.Host/Styles"
|
WORKDIR "/src/Hosts/Moonlight.Frontend.Host/Styles"
|
||||||
RUN npm run build
|
RUN bun run build
|
||||||
|
|
||||||
# Build projects
|
# Build projects
|
||||||
WORKDIR "/src/Hosts/Moonlight.Api.Host"
|
WORKDIR "/src/Hosts/Moonlight.Api.Host"
|
||||||
|
|||||||
58
compose.yml
58
compose.yml
@@ -11,6 +11,7 @@
|
|||||||
args:
|
args:
|
||||||
HTTP_PROXY: ${HTTP_PROXY}
|
HTTP_PROXY: ${HTTP_PROXY}
|
||||||
HTTPS_PROXY: ${HTTPS_PROXY}
|
HTTPS_PROXY: ${HTTPS_PROXY}
|
||||||
|
GIT_BRANCH: ${GIT_BRANCH:-v2.1}
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -40,31 +41,66 @@
|
|||||||
- "Moonlight__OIDC__Scopes__0=openid"
|
- "Moonlight__OIDC__Scopes__0=openid"
|
||||||
- "Moonlight__OIDC__Scopes__1=identify"
|
- "Moonlight__OIDC__Scopes__1=identify"
|
||||||
- "Moonlight__OIDC__Scopes__2=email"
|
- "Moonlight__OIDC__Scopes__2=email"
|
||||||
|
|
||||||
|
# Container Helper
|
||||||
|
- "Moonlight__ContainerHelper__IsEnabled=true"
|
||||||
|
- "Moonlight__ContainerHelper__Url=http://helper:8080"
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
- "Logging__LogLevel__Default=Information"
|
- "Logging__LogLevel__Default=Information"
|
||||||
- "Logging__LogLevel__Microsoft.AspNetCore=Warning"
|
- "Logging__LogLevel__Microsoft.AspNetCore=Warning"
|
||||||
|
- "Logging__LogLevel__System.Net.Http.HttpClient=Warning"
|
||||||
|
|
||||||
|
# HTTP Proxy
|
||||||
|
- "HTTP_PROXY=${HTTP_PROXY}"
|
||||||
|
- "HTTPS_PROXY=${HTTPS_PROXY}"
|
||||||
|
- "NO_PROXY=database,helper"
|
||||||
|
|
||||||
database:
|
database:
|
||||||
image: postgres:18.1
|
image: postgres:18.1
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- moonlight
|
||||||
|
|
||||||
|
environment:
|
||||||
|
- "POSTGRES_USER=${DATABASE_USERNAME}"
|
||||||
|
- "POSTGRES_PASSWORD=${DATABASE_PASSWORD}"
|
||||||
|
- "POSTGRES_DB=${DATABASE_DATABASE}"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- ${DATA_PATH}/database:/var/lib/postgresql
|
||||||
|
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "pg_isready", "-q", "-d", "${DATABASE_DATABASE}", "-U", "${DATABASE_USERNAME}" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
helper:
|
||||||
|
image: git.battlestati.one/moonlight-panel/container_helper
|
||||||
|
|
||||||
|
group_add:
|
||||||
|
- "${DOCKER_GID}"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- moonlight
|
- moonlight
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- "POSTGRES_USER=${DATABASE_USERNAME}"
|
# Logging
|
||||||
- "POSTGRES_PASSWORD=${DATABASE_PASSWORD}"
|
- "Logging__LogLevel__Default=Information"
|
||||||
- "POSTGRES_DB=${DATABASE_DATABASE}"
|
- "Logging__LogLevel__Microsoft.AspNetCore=Warning"
|
||||||
- "PGDATA=/pgdata"
|
|
||||||
|
# Compose
|
||||||
|
- "ContainerHelper__Compose__Directory=${PWD}"
|
||||||
|
- "ContainerHelper__Compose__Binary=docker-compose"
|
||||||
|
|
||||||
|
# HTTP Proxy
|
||||||
|
- "HTTP_PROXY=${HTTP_PROXY}"
|
||||||
|
- "HTTPS_PROXY=${HTTPS_PROXY}"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/database:/var/lib/postgresql/data
|
- "${PWD}:${PWD}"
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
healthcheck:
|
|
||||||
test: [ "CMD", "pg_isready", "-q", "-d", $DATABASE_DATABASE, "-U", $DATABASE_USERNAME]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
moonlight:
|
moonlight:
|
||||||
Reference in New Issue
Block a user