feature/scel-base #1

Merged
kjuulh merged 4 commits from feature/scel-base into 07-17-remove_ticker 2022-07-18 13:16:06 +02:00
3 changed files with 56 additions and 0 deletions
Showing only changes of commit 62ba975afd - Show all commits

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
target/
.git/
.env
data/

31
.drone.yml Normal file
View File

@ -0,0 +1,31 @@
kind: pipeline
name: default
type: docker
steps:
- name: server
image: plugins/docker
environment:
DOCKER_BUILDKIT: 1
settings:
username: kasperhermansen
password:
from_secret:
docker_secret
repo: kasperhermansen/scel
tags: latest
context: .
dockerfile: Dockerfile
cache_from: kasperhermansen/scel:latest
- name: send telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to: 2129601481
format: markdown
depends_on:
- server
when:
status: [failure]

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM rust:1.60 as builder
WORKDIR /usr/src/scel
COPY . .
RUN --mount=type=cache,target=/usr/src/scel/target cargo build --release
RUN --mount=type=cache,target=/usr/src/scel/target cargo install --path src/cmd/scel
FROM debian:bullseye-slim
# Install YTD
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
apt-get update && apt-get install -y python3 python3-pip
RUN python3 -m pip install -U yt-dlp
# Copy binary
COPY --from=builder /usr/local/cargo/bin/scel /usr/local/bin/scel
CMD ["scel"]