Containerfile 618 B

1234567891011121314151617181920212223
  1. # Build executable in builder container
  2. FROM docker.io/rust:1.87-alpine as builder
  3. WORKDIR /usr/src/myapp
  4. RUN apk add --no-cache openssl-dev openssl-libs-static musl-dev
  5. COPY Cargo.toml .
  6. COPY Cargo.lock .
  7. COPY README.md .
  8. COPY src src
  9. COPY static static
  10. COPY tmpl tmpl
  11. RUN cargo install --path . -F bundled_templates
  12. # Build final UIDC container
  13. FROM docker.io/alpine:3
  14. RUN apk add --no-cache tini
  15. RUN mkdir /uidc/
  16. VOLUME ["/uidc/"]
  17. ENV UIDC_CONFIG=/uidc/uidc.toml
  18. COPY --from=builder /usr/local/cargo/bin/uidc /usr/local/bin/uidc
  19. WORKDIR /uidc/
  20. ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/uidc"]
  21. CMD ["serve"]