Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Publish Docker Image

on:
push:
branches:
- main

jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest

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

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ secrets.DOCKER_USERNAME }}/meloday:latest
${{ secrets.DOCKER_USERNAME }}/meloday:${{ github.sha }}
44 changes: 44 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:3.21

# copy all necessary files in a single step
COPY requirements.txt /tmp/requirements.txt

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
openssl-dev \
python3-dev \
git && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
gnupg \
python3 \
py3-pip && \
echo "**** verify installed packages ****" && \
python3 --version && \
pip --version && \
git --version && \
echo "**** install app ****" && \
python3 -m venv /lsiopy && \
/lsiopy/bin/pip install -U --no-cache-dir \
pip \
wheel && \
/lsiopy/bin/pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \
-r /tmp/requirements.txt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
$HOME/.cache

# copy all necessary files in a single step
COPY root/ /
COPY meloday.py /tmp/meloday.py
COPY assets/ /tmp/assets/
COPY config.yml /tmp/config.yml

# volumes
VOLUME /config
Loading