no docker, only nix
parent
5d3bdd5249
commit
7114578d60
|
@ -5,29 +5,21 @@ steps:
|
|||
# - 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:
|
||||
# - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
# - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf
|
||||
# - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker
|
||||
|
||||
build-docker-image:
|
||||
image: docker
|
||||
image: alpine:edge
|
||||
commands:
|
||||
- docker buildx build .
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
- echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf
|
||||
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker
|
||||
|
||||
# publish-image:
|
||||
# when:
|
||||
# event: [tag, deployment]
|
||||
# environment: prod
|
||||
# image: git.spacegirl.nl/patrick/plugin-artifact
|
||||
# settings:
|
||||
# tag: $CI_COMMIT_TAG
|
||||
# user: patrick
|
||||
# password:
|
||||
# from_secret: forgejo_token
|
||||
# repo: $CI_REPO
|
||||
# image_tar: result
|
||||
publish-image:
|
||||
when:
|
||||
event: tag
|
||||
image: git.spacegirl.nl/patrick/plugin-artifact
|
||||
settings:
|
||||
tag: $CI_COMMIT_TAG
|
||||
user: patrick
|
||||
password:
|
||||
from_secret: forgejo_token
|
||||
repo: $CI_REPO
|
||||
image_tar: result
|
||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,36 +0,0 @@
|
|||
FROM rust:1.71.0-slim AS builder
|
||||
|
||||
RUN USER=root cargo new --bin memejoin-docker
|
||||
|
||||
RUN apt update \
|
||||
&& apt install -y ca-certificates git cmake gcc libopus-dev libssl-dev pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
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:bookworm
|
||||
ARG APP=/usr/src/app
|
||||
|
||||
RUN apt update \
|
||||
&& apt install -y ca-certificates yt-dlp ffmpeg libopus0 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"]
|
Loading…
Reference in New Issue