2020-11-23 08:59:06 -07:00
|
|
|
# syntax=docker/dockerfile:experimental
|
|
|
|
FROM rust:1.47-buster as rust
|
|
|
|
|
|
|
|
ENV HOME=/home/root
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Copy the source folders
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
# Build for debug
|
|
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
|
|
--mount=type=cache,target=/app/target \
|
|
|
|
cargo build
|
|
|
|
RUN --mount=type=cache,target=/app/target \
|
|
|
|
cp target/debug/lemmy_server lemmy_server
|
|
|
|
|
2021-01-05 22:27:58 -07:00
|
|
|
FROM rust:1.47-buster as docs
|
2020-11-23 08:59:06 -07:00
|
|
|
WORKDIR /app
|
2021-01-05 22:27:58 -07:00
|
|
|
RUN cargo install mdbook --git https://github.com/Ruin0x11/mdBook.git \
|
|
|
|
--branch localization --rev d06249b --force
|
2020-11-23 08:59:06 -07:00
|
|
|
COPY docs ./docs
|
|
|
|
RUN mdbook build docs/
|
|
|
|
|
|
|
|
FROM ubuntu:20.10
|
|
|
|
|
|
|
|
# Install libpq for postgres and espeak
|
|
|
|
RUN apt-get update -y
|
|
|
|
RUN apt-get install -y libpq-dev espeak
|
|
|
|
|
|
|
|
# Copy resources
|
|
|
|
COPY config/defaults.hjson /config/defaults.hjson
|
|
|
|
COPY --from=rust /app/lemmy_server /app/lemmy
|
|
|
|
COPY --from=docs /app/docs/book/ /app/documentation/
|
|
|
|
|
|
|
|
EXPOSE 8536
|
|
|
|
CMD ["/app/lemmy"]
|