-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
22 lines (20 loc) · 815 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Create a Rust builder with stable Rust. Disable static linking of musl because it segfaults.
FROM alpine:latest AS rust-base
RUN apk --no-cache add build-base rustup
RUN rustup-init -y
ENV RUSTFLAGS="-C target-feature=-crt-static"
ENV PATH="/root/.cargo/bin:$PATH"
# Build our app in release mode.
FROM rust-base AS rust-builder
WORKDIR /app
COPY ./ /app
RUN cargo build --release
# Create a deployable image from base Alpine with ImageMagick, and SQLite (for admin stuff), set to
# my time zone, with just the compiled binary.
FROM alpine:latest
RUN apk --no-cache add imagemagick sqlite tzdata && \
cp /usr/share/zoneinfo/America/Denver /etc/localtime && \
echo "America/Denver" > /etc/timezone && \
apk del tzdata
COPY --from=rust-builder /app/target/release/yellhole .
ENTRYPOINT ["/yellhole"]