feat: build docker

This commit is contained in:
2025-02-27 13:45:19 +00:00
parent d28d6637f8
commit 4ae98658b7
4 changed files with 61 additions and 20 deletions

24
.drone.yml Normal file
View File

@ -0,0 +1,24 @@
kind: pipeline
type: kubernetes
name: default
metadata:
namespace: git
concurrency:
limit: 1
trigger:
branch:
- main
event:
- push
steps:
- name: build
image: docker
privileged: true
environment:
TOKEN_DOCKER:
from_secret: docker_hub
commands:
- dockerd &
- docker login -u voidic -p $TOKEN_DOCKER
- docker buildx build --push -t voidic/tiktok-dvm:latest .
- kill $(cat /var/run/docker.pid)

38
Cargo.lock generated
View File

@ -1713,25 +1713,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "rust_dvm"
version = "0.1.0"
dependencies = [
"anyhow",
"base64",
"clap",
"env_logger",
"hex",
"log",
"nostr-sdk",
"reqwest",
"serde",
"sha2",
"tokio",
"url",
"yt-dlp",
]
[[package]]
name = "rustc-demangle"
version = "0.1.24"
@ -2123,6 +2104,25 @@ dependencies = [
"syn",
]
[[package]]
name = "tiktok_dvm"
version = "0.1.0"
dependencies = [
"anyhow",
"base64",
"clap",
"env_logger",
"hex",
"log",
"nostr-sdk",
"reqwest",
"serde",
"sha2",
"tokio",
"url",
"yt-dlp",
]
[[package]]
name = "time"
version = "0.3.37"

View File

@ -1,5 +1,5 @@
[package]
name = "rust_dvm"
name = "tiktok_dvm"
version = "0.1.0"
edition = "2021"

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
ARG IMAGE=rust:bookworm
ARG FEATURES
FROM $IMAGE AS build
WORKDIR /app/src
COPY src src
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
RUN cargo install --path . --root /app/build --features "${FEATURES}"
FROM $IMAGE AS runner
LABEL org.opencontainers.image.source="https://git.v0l.io/Kieran/tiktok-dvm"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Kieran"
WORKDIR /app
COPY --from=build /app/build .
ENTRYPOINT ["./bin/tiktok_dvm"]