mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Add image with Ubuntu base (#661)
This commit is contained in:
@@ -19,7 +19,15 @@ runs:
|
|||||||
username: ${{ inputs.ghcr_username }}
|
username: ${{ inputs.ghcr_username }}
|
||||||
password: ${{ inputs.ghcr_token }}
|
password: ${{ inputs.ghcr_token }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Prepare Ubuntu tags
|
||||||
|
id: ubuntu_tags
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
TAGS="${{ inputs.tags }}"
|
||||||
|
UBUNTU_TAGS=$(echo "$TAGS" | awk -F, '{for(i=1;i<=NF;i++){split($i,a,":"); printf "%s:%s-ubuntu", a[1], a[2]; if(i<NF) printf ","}}')
|
||||||
|
echo "ubuntu_tags=$UBUNTU_TAGS" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push Docker image (Alpine)
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ${{ inputs.context }}
|
context: ${{ inputs.context }}
|
||||||
@@ -30,6 +38,17 @@ runs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha
|
cache-to: type=gha
|
||||||
|
|
||||||
|
- name: Build and push Docker image (Ubuntu)
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: ${{ inputs.context }}
|
||||||
|
file: docker/Dockerfile.ubuntu
|
||||||
|
platforms: ${{ inputs.platforms }}
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.ubuntu_tags.outputs.ubuntu_tags }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
dockerhub_username:
|
dockerhub_username:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
|
FROM eclipse-temurin:21-jre
|
||||||
|
|
||||||
|
MAINTAINER grimsi
|
||||||
|
|
||||||
|
# Install necessary packages
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y tini gosu && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV USER=gameyfin
|
||||||
|
|
||||||
|
RUN groupadd gameyfin && \
|
||||||
|
useradd -M -g gameyfin gameyfin
|
||||||
|
|
||||||
|
WORKDIR /opt/gameyfin
|
||||||
|
|
||||||
|
# Create necessary directories with appropriate permissions
|
||||||
|
RUN mkdir -p plugins db data logs && \
|
||||||
|
chown -R gameyfin:gameyfin .
|
||||||
|
|
||||||
|
# Copy entrypoint script and set permissions
|
||||||
|
COPY --chown=gameyfin:gameyfin ./docker/entrypoint.ubuntu.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
# Copy application jar (not ending with -plain.jar)
|
||||||
|
COPY --chown=gameyfin:gameyfin ./app/build/libs/ /tmp/app-libs/
|
||||||
|
RUN find /tmp/app-libs -type f -name "*.jar" ! -name "*-plain.jar" -exec cp {} gameyfin.jar \; && \
|
||||||
|
rm -rf /tmp/app-libs
|
||||||
|
|
||||||
|
# Copy all plugin jars
|
||||||
|
COPY --chown=gameyfin:gameyfin ./plugins/ /tmp/plugins/
|
||||||
|
RUN find /tmp/plugins -type f -path "*/build/libs/*.jar" -exec cp {} plugins/ \; && \
|
||||||
|
rm -rf /tmp/plugins
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -n "$PUID" ] && [ -n "$PGID" ]; then
|
||||||
|
groupmod -o -g "$PGID" gameyfin
|
||||||
|
usermod -o -u "$PUID" gameyfin
|
||||||
|
chown -R gameyfin:gameyfin /opt/gameyfin
|
||||||
|
exec gosu gameyfin:gameyfin java -jar gameyfin.jar
|
||||||
|
else
|
||||||
|
exec gosu gameyfin:gameyfin java -jar gameyfin.jar
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user