Merge pull request #135 from JSchmie/update_dockerfile
Update dockerfile
This commit is contained in:
@@ -0,0 +1,95 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
# GitHub recommends pinning actions to a commit SHA.
|
||||||
|
# To get a newer version, you will need to update the SHA.
|
||||||
|
# You can also reference a tag or branch, but the action may change without warning.
|
||||||
|
|
||||||
|
name: Publish Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
image: hadr0n/scraibe
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push_to_registry:
|
||||||
|
name: Push Docker image to Docker Hub
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get Version Tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Overwrite label tag
|
||||||
|
run: sed -i 's/LABEL version=".*"/LABEL version="'${{ steps.version.outputs.tag }}'"/' Dockerfile
|
||||||
|
|
||||||
|
- name: Test name and tag
|
||||||
|
run: |
|
||||||
|
echo "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}"
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
id: push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}"
|
||||||
|
|
||||||
|
- name: SBOM Generation
|
||||||
|
uses: anchore/sbom-action@v0
|
||||||
|
with:
|
||||||
|
image: ${{ env.image }}:latest
|
||||||
|
|
||||||
|
- name: Scan image
|
||||||
|
id: scan
|
||||||
|
uses: anchore/scan-action@v3
|
||||||
|
with:
|
||||||
|
image: ${{ env.image }}:latest
|
||||||
|
fail-build: false
|
||||||
|
|
||||||
|
- name: upload Anchore scan SARIF report
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: ${{ steps.scan.outputs.sarif }}
|
||||||
|
|
||||||
|
# - name: Inspect action SARIF report
|
||||||
|
# run: cat ${{ steps.scan.outputs.sarif }}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: SARIF report
|
||||||
|
path: ${{ steps.scan.outputs.sarif }}
|
||||||
|
|
||||||
|
# - name: Generate artifact attestation
|
||||||
|
# uses: actions/attest-build-provenance@v1
|
||||||
|
# with:
|
||||||
|
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
|
||||||
|
# subject-digest: ${{ steps.push.outputs.digest }}
|
||||||
|
# push-to-registry: false
|
||||||
+18
-20
@@ -1,5 +1,5 @@
|
|||||||
#pytorch Image
|
#pytorch Image
|
||||||
FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime
|
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
|
||||||
|
|
||||||
# Labels
|
# Labels
|
||||||
|
|
||||||
@@ -14,33 +14,31 @@ LABEL url="https://github.com/JSchmie/ScrAIbe"
|
|||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ARG model_name=medium
|
#Enviorment dependencies
|
||||||
#Enviorment Dependncies
|
ENV TRANSFORMERS_CACHE=/app/models
|
||||||
ENV TRANSFORMERS_CACHE /app/models
|
ENV HF_HOME=/app/models
|
||||||
ENV HF_HOME /app/models
|
ENV AUTOT_CACHE=/app/models
|
||||||
ENV AUTOT_CACHE /app/models
|
ENV PYANNOTE_CACHE=/app/models/pyannote
|
||||||
ENV PYANNOTE_CACHE /app/models/pyannote
|
|
||||||
#Copy all necessary files
|
#Copy all necessary files
|
||||||
COPY requirements.txt /app/requirements.txt
|
COPY requirements.txt /app/requirements.txt
|
||||||
COPY README.md /app/README.md
|
COPY README.md /app/README.md
|
||||||
COPY models /app/models
|
|
||||||
COPY scraibe /app/scraibe
|
COPY scraibe /app/scraibe
|
||||||
COPY setup.py /app/setup.py
|
|
||||||
|
|
||||||
#Installing all necessary Dependencies and Running the Application with a personalised Hugging-Face-Token
|
#Installing all necessary dependencies and running the application with a personalised Hugging-Face-Token
|
||||||
RUN apt update && apt-get install -y libsm6 libxrender1 libfontconfig1
|
RUN apt update -y && apt upgrade -y && \
|
||||||
RUN conda update --all
|
apt install -y libsm6 libxrender1 libfontconfig1 && \
|
||||||
|
apt clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
RUN conda install pip
|
RUN conda update --all && \
|
||||||
RUN conda install -y ffmpeg
|
# conda install -y pip ffmpeg && \
|
||||||
RUN conda install -c conda-forge libsndfile
|
conda install -c conda-forge libsndfile && \
|
||||||
RUN pip install torchaudio==0.11.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
conda clean --all -y
|
||||||
RUN pip install -r requirements.txt
|
# RUN pip install torchaudio==0.11.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
||||||
RUN pip install markupsafe==2.0.1 --force-reinstall
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
RUN python3 -m 'scraibe.cli' --whisper-model-name $model_name
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 7860
|
EXPOSE 7860
|
||||||
# Run the application
|
# Run the application
|
||||||
|
|
||||||
ENTRYPOINT ["python3", "-m", "scraibe.cli" ,"--whisper-model-name", "$model_name"]
|
ENTRYPOINT ["python3", "-m", "scraibe.cli"]
|
||||||
Reference in New Issue
Block a user