Compare commits

..

6 Commits

Author SHA1 Message Date
Patrick Cleavelin cfbe0b71a9 no docker, only nix
use correct tag

just use docker instead of artifact

save result of nix build in persistent volume
2023-07-31 15:25:46 -05:00
Patrick Cleavelin 575c2fa6d0 docker? 2023-07-31 15:22:27 -05:00
Patrick Cleavelin 182de458ee will this actually work, probably not 2023-07-31 15:22:27 -05:00
Patrick Cleavelin 444203405d update syntax 2023-07-31 15:22:27 -05:00
Patrick Cleavelin fa83ca21e3 remove asdf 2023-07-31 15:22:27 -05:00
Patrick Cleavelin c749134a2f ci maybe? 2023-07-31 15:22:27 -05:00
3 changed files with 32 additions and 21 deletions

View File

@ -1,10 +1,4 @@
steps:
# build:
# image: alpine:edge
# commands:
# - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
# - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#default
build-docker-image:
image: alpine:edge
commands:
@ -25,17 +19,3 @@ steps:
- docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# publish-image:
# when:
# event: tag
# image: git.spacegirl.nl/patrick/plugin-artifact:v0.1.1
# settings:
# tag: $CI_COMMIT_TAG
# user: patrick
# password:
# from_secret: forgejo_token
# repo: $CI_REPO
# image_tar: result
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock

31
Dockerfile Normal file
View File

@ -0,0 +1,31 @@
FROM rust-1.73.0-slim AS builder
RUN USER=root cargo new --bin memejoin-docker
WORKDIR ./memejoin-docker
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release
RUN rm src/*.rs
ADD . ./
RUN rm ./target/release/deps/memejoin-docker
RUN cargo build --release
FROM debian:buster-slim
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y ca-certificates cmake gcc libopus libssl openssl pkg-config \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 8100
RUN groupadd $APP_USER && useradd -g $APP_USER $APP_USER && mkdir -p ${APP}
COPY --from=builder /memejoin-docker/target/release/memejoin-docker ${APP}/memejoin-docker
RUN chown -R $APP_USER:$APP_USER ${APP}
USER $APP_USER
WORKDIR ${APP}
CMD ["./memejoin-docker"]

View File

@ -8,7 +8,7 @@
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
tag = "super_test";
tag = "0.1.4_3-alpha";
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;