NyaNS/Dockerfile
2023-01-05 00:09:51 +01:00

29 lines
599 B
Docker

FROM rust:alpine AS build
# Fix missing crti.o by adding muslc devlibs
RUN apk add --no-cache musl-dev
WORKDIR /usr/src
COPY . .
ENV CARGO_HOME=/tmp/cargo
RUN --mount=type=cache,target=/usr/src/target --mount=type=cache,target=/tmp/cargo cargo build --release
RUN --mount=type=cache,target=/usr/src/target cp /usr/src/target/release/nyans /tmp/nyans
FROM alpine:latest AS runtime
RUN apk add --no-cache bind bind-tools
COPY --from=build /tmp/nyans /usr/bin/nyans
EXPOSE 53/tcp
EXPOSE 53/udp
EXPOSE 2137/tcp
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=2137
ENTRYPOINT [ "/usr/bin/nyans" ]