Add build

This commit is contained in:
kieran 2024-08-08 18:46:23 +01:00
parent d22af45d12
commit 02bc00754c
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
2 changed files with 31 additions and 0 deletions

20
.drone.yml Normal file
View File

@ -0,0 +1,20 @@
kind: pipeline
type: kubernetes
name: default
metadata:
namespace: git
steps:
- name: build
image: docker
privileged: true
environment:
TOKEN:
from_secret: registry_token
commands:
- dockerd &
- docker login -u registry -p $TOKEN registry.v0l.io
- docker build -t registry.v0l.io/nostr-services-rs:latest .
- docker push registry.v0l.io/nostr-services-rs:latest
- kill $(cat /var/run/docker.pid)

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
ARG IMAGE=rust:bookworm
FROM $IMAGE AS build
WORKDIR /app/src
COPY . .
RUN cargo install --path . --root /app/build
FROM $IMAGE AS runner
WORKDIR /app
COPY --from=build /app/build .
ENTRYPOINT ["./bin/nostr_services_rs"]