Skip to content

Commit

Permalink
Merge pull request #2 from davidemarcoli/dockerfile
Browse files Browse the repository at this point in the history
Dockerfile
  • Loading branch information
g0ldyy authored Jun 25, 2024
2 parents 949f17c + 7141682 commit f07b3da
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github/
.env*
.gitignore
Dockerfile
LICENSE
README.md
56 changes: 56 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker Build and Push

on:
push:
branches:
- main
# release:
# types: [created]
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
security-events: write

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3
id: qemu
with:
platforms: amd64,arm64

- name: Log into ghcr.io registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/g0ldyy/comet:latest
docker.io/g0ldyy/comet:latest
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.11
LABEL name="Comet" \
description="Stremio's fastest torrent/debrid search add-on." \
url="https://github.com/g0ldyy/comet"

# This is to prevent Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1

# Install Poetry
RUN pip install poetry

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Set working directory
WORKDIR /app

# Copy the application code
COPY . ./

RUN poetry install --no-root

ENV VIRTUAL_ENV=/app/.venv
ENV PATH="/app/.venv/bin:$PATH"

CMD ["python", "run.py"]

0 comments on commit f07b3da

Please sign in to comment.