Add Dockerfile

This commit is contained in:
Tom Bloor 2024-04-21 23:43:48 +01:00
parent 28d5fd71fb
commit c9745d292e
Signed by: TBSliver
GPG key ID: 4657C7EBE42CC5CC
2 changed files with 26 additions and 0 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
.idea
.git
target

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM rust:1.77.2-alpine3.19 as builder
RUN rustup --version
RUN rustup show
RUN apk add pkgconfig openssl-dev musl-dev
WORKDIR /usr/src/rust-twitch-avatar-cache
COPY . .
ENV RUSTFLAGS='-C target-feature=-crt-static'
RUN cargo install --verbose --path .
FROM alpine:3.19
RUN apk add --no-cache libgcc
COPY --from=builder /usr/local/cargo/bin/rust-twitch-avatar-cache /usr/local/bin/rust-twitch-avatar-cache
CMD ["rust-twitch-avatar-cache"]