Skip to content

Commit

Permalink
set up docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
BeautyyuYanli committed Jun 25, 2024
1 parent 804b24a commit 41c001f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/${{ github.actor }}/${{ github.repository }}:${{ inputs.version }}
17 changes: 17 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends \
make \
build-essential \
git \
ca-certificates \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app_build
COPY src/ pdm.lock pyproject.toml README.md /app_build/
RUN pdm use $(which python)
RUN pdm sync
RUN pip install pytorch-lightning==2.0.3 nltk>=3.8.1 pdm
RUN python -m nltk.downloader averaged_perceptron_tagger && \
python -m nltk.downloader cmudict
RUN pdm cache clear
WORKDIR /workspace

0 comments on commit 41c001f

Please sign in to comment.