chore: add Dockerfile

user-register
Jef Roosens 2023-05-14 23:36:29 +02:00
parent 21742a2317
commit 3fbec90bb4
2 changed files with 35 additions and 0 deletions

2
.dockerignore 100644
View File

@ -0,0 +1,2 @@
.woodpecker/
target/

33
Dockerfile 100644
View File

@ -0,0 +1,33 @@
FROM rust:1.69-alpine AS builder
ARG DI_VER=1.2.5
RUN apk update && \
apk add --no-cache build-base curl
WORKDIR /build
# Build dumb-init
RUN curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.tar.gz" | tar -xzf - && \
cd "dumb-init-${DI_VER}" && \
make SHELL=/bin/sh && \
mv dumb-init ..
WORKDIR /build/affy
COPY ./ ./
RUN cargo build --release && \
[ "$(readelf -d target/release/affy | grep NEEDED | wc -l)" = 0 ]
FROM busybox:1.36.0
COPY --from=builder /build/dumb-init /build/affy/target/release/affy /bin/
WORKDIR /data
USER www-data:www-data
ENTRYPOINT ["/bin/dumb-init", "--"]
CMD ["/bin/affy"]