29 lines
887 B
Docker
29 lines
887 B
Docker
FROM docker.io/library/rust AS builder
|
|
|
|
ARG BUILD_MODE=debug
|
|
|
|
RUN apt-get update && apt-get install -y fuse3 libfuse3-dev && apt-get clean
|
|
|
|
WORKDIR /app
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
|
RUN cargo fetch
|
|
RUN rm -rf src
|
|
|
|
COPY src ./src
|
|
COPY migrations ./migrations
|
|
COPY .sqlx ./.sqlx
|
|
|
|
RUN cargo build $(if [ "$BUILD_MODE" = "release" ]; then echo "--release"; else echo ""; fi)
|
|
RUN mkdir -p build && cp target/$(if [ "$BUILD_MODE" = "release" ]; then echo "release"; else echo "debug"; fi)/glyph build/glyph
|
|
|
|
FROM docker.io/authelia/authelia
|
|
|
|
COPY --from=builder /app/build/glyph /usr/bin/glyph
|
|
COPY --from=builder /usr/lib/x86_64-linux-gnu/libfuse3.so.3 /usr/lib/x86_64-linux-gnu/libfuse3.so.3
|
|
COPY --from=builder /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
|
|
|
|
ENTRYPOINT ["/usr/bin/glyph"]
|
|
CMD ["--help"]
|