add docker + workflow
This commit is contained in:
parent
64215f5b70
commit
bb8a125ff1
4 changed files with 56 additions and 0 deletions
25
.gitea/workflows/build.yml
Normal file
25
.gitea/workflows/build.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- name: Log in to Docker registry
|
||||
run: echo "${{ secrets.registry_password }}" | docker login -u "${{ secrets.registry_user }}" --password-stdin git.hydrar.de
|
||||
|
||||
- name: Build and push Docker image
|
||||
run: |
|
||||
docker build -t git.hydrar.de/jmarya/hoard:latest .
|
||||
docker push git.hydrar.de/jmarya/hoard:latest
|
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
@ -0,0 +1,19 @@
|
|||
FROM rust:buster as builder
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM archlinux
|
||||
|
||||
# Install dependencies for yt-dlp and ffmpeg
|
||||
RUN pacman -Syu --noconfirm && \
|
||||
pacman -S --noconfirm ca-certificates ffmpeg yt-dlp && \
|
||||
rm -rf /var/cache/pacman/pkg/*
|
||||
|
||||
COPY --from=builder /app/target/release/hoard /hoard
|
||||
|
||||
WORKDIR /
|
||||
|
||||
CMD ["/hoard"]
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
build: "."
|
||||
environment:
|
||||
TZ: Europe/Berlin
|
||||
volumes:
|
||||
- ./download:/download
|
||||
- ./download.db:/download.db
|
||||
- ./config.toml:/config.toml
|
|
@ -7,6 +7,7 @@ mod youtube;
|
|||
use config::GlobalConfig;
|
||||
|
||||
// todo : migrate to async code?
|
||||
// todo : better log options
|
||||
|
||||
pub fn ensure_dir_exists(dir_path: &PathBuf) {
|
||||
let path = std::path::Path::new(dir_path);
|
||||
|
|
Loading…
Reference in a new issue