diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..59ab970 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,61 @@ +name: Docker + +# 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. + +on: + push: + branches: [ master ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ master ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dd5b040 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.8-alpine + +WORKDIR /uploads +VOLUME /uploads + +RUN apk add gcc musl-dev libffi-dev openssl-dev + +RUN pip install updog + +EXPOSE 9090 + +CMD ["updog"] + diff --git a/README.md b/README.md index b5c5d5f..0dd2a95 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![Version 1.4](http://img.shields.io/badge/version-v1.4-green.svg) -![Python 3.8](http://img.shields.io/badge/python-3.8-blue.svg) -[![MIT License](http://img.shields.io/badge/license-MIT%20License-blue.svg)](https://github.com/sc0tfree/updog/blob/master/LICENSE) -[![sc0tfree Twitter](http://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow)](https://twitter.com/sc0tfree) - +![GitHub release (latest by date)](https://img.shields.io/github/v/release/sc0tfree/updog?color=success&style=flat-square) +![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg?style=flat-square) +![GitHub](https://img.shields.io/github/license/crstian19/updog?color=blue&logoColor=blue&style=flat-square) +![Docker Pulls](https://img.shields.io/docker/pulls/crstian/updog?logo=Docker&style=flat-square) +![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/crstian/updog?logo=Docker&style=flat-square)

updog

diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..833cbed --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + updong: + build: . + volumes: + - '/YOUR/PATH:/uploads' + ports: + - 9090:9090 + restart: unless-stopped