This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
glyph/support/Containerfile
Nikolaos Karaolidis ed958a8ed0 Add sqlx
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-06-05 14:24:48 +01:00

29 lines
686 B
Docker

FROM docker.io/library/rust AS builder
ARG BUILD_MODE=debug
RUN apt-get update && 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/library/debian:bookworm-slim
COPY --from=builder /app/build/glyph /usr/local/bin/glyph
EXPOSE 8080/tcp
ENTRYPOINT ["/usr/local/bin/glyph"]
CMD ["--help"]