add .gitlab-ci.yml

add Dockerfile
This commit is contained in:
lychang
2024-01-12 04:21:33 +08:00
parent 86e60f1e5c
commit a4be88e901
3 changed files with 1606 additions and 3 deletions

View File

@@ -1,4 +1,20 @@
FROM ubuntu:latest
LABEL authors="123ee"
FROM rust:1.50 as builder
ENTRYPOINT ["top", "-b"]
WORKDIR /app
ARG APP=imspyder
RUN USER=root cargo new $APP
WORKDIR /app/$APP
RUN mkdir -p .cargo
COPY config.toml .cargo/
COPY Cargo.toml Cargo.lock ./
COPY ./src src
RUN cargo install --path . --color always
# Copy the app to an base Docker image, here we use distroless
FROM alpine:latest
RUN mkdir -p /cache
COPY --from=builder /usr/local/cargo/bin/$APP /$APP
USER 1000
ENTRYPOINT ["/$APP"]