2021-04-01 09:05:22 +13:00
|
|
|
FROM rust:alpine as builder
|
2020-10-26 09:48:44 +13:00
|
|
|
WORKDIR /usr/src/libreddit
|
|
|
|
COPY . .
|
2021-04-01 09:05:22 +13:00
|
|
|
RUN apk add --no-cache g++
|
2020-10-26 09:48:44 +13:00
|
|
|
RUN cargo install --path .
|
|
|
|
|
2021-04-01 09:05:22 +13:00
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache curl
|
2021-02-25 08:17:36 +13:00
|
|
|
COPY --from=builder /usr/local/cargo/bin/libreddit /usr/local/bin/libreddit
|
2021-04-02 08:09:08 +13:00
|
|
|
RUN adduser --system --home /nonexistent --no-create-home --disabled-password libreddit
|
|
|
|
USER libreddit
|
2021-02-25 08:17:36 +13:00
|
|
|
EXPOSE 8080
|
2021-04-01 09:05:22 +13:00
|
|
|
HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost:8080/settings || exit 1
|
2021-04-02 08:09:08 +13:00
|
|
|
|
2021-04-01 09:05:22 +13:00
|
|
|
CMD ["libreddit"]
|