Hexbear is the engine that powers Chapochat. It is a customization of the Lemmy project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3 KiB

4 years ago
  1. ARG RUST_BUILDER=ekidd/rust-musl-builder:latest
  2. FROM $RUST_BUILDER as planner
  3. # Cache deps
  4. WORKDIR /app
  5. #install cargo chef
  6. RUN cargo install cargo-chef
  7. RUN sudo chown -R rust:rust .
  8. WORKDIR /app/server
  9. COPY server/ .
  10. # list off needed dependencies
  11. RUN cargo chef prepare --recipe-path recipe.json
  12. FROM ${RUST_BUILDER} as cacher
  13. WORKDIR /app/server
  14. RUN cargo install cargo-chef
  15. COPY --from=planner /app/server/recipe.json recipe.json
  16. RUN sudo chown -R rust:rust .
  17. RUN cargo chef cook --recipe-path recipe.json
  18. FROM ${RUST_BUILDER} as builder
  19. WORKDIR /app/server
  20. COPY server/ .
  21. COPY --from=cacher /app/server/target ./target
  22. COPY --from=cacher /home/rust/.cargo /home/rust/.cargo
  23. RUN sudo chown -R rust:rust .
  24. RUN cargo build
  25. FROM ${RUST_BUILDER} as docs
  26. WORKDIR /app
  27. COPY docs ./docs
  28. RUN sudo chown -R rust:rust .
  29. RUN mdbook build docs/
  30. FROM alpine:3.12 as runner
  31. # Install libpq for postgres
  32. RUN apk add libpq
  33. # Install Espeak for captchas
  34. RUN apk add espeak
  35. # Copy resources
  36. COPY server/config/defaults.hjson /config/defaults.hjson
  37. COPY --from=builder /app/server/target/x86_64-unknown-linux-musl/debug/lemmy_server /app/lemmy
  38. COPY --from=docs /app/docs/book/ /app/dist/documentation/
  39. RUN addgroup -g 1000 lemmy
  40. RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy
  41. RUN chown lemmy:lemmy /app/lemmy
  42. USER lemmy
  43. EXPOSE 8536
  44. CMD ["/app/lemmy"]