]> Untitled Git - lemmy.git/blob - docker/dev/volume_mount.dockerfile
a6724a868964dffd8d7863e92b12f215633fb2bf
[lemmy.git] / docker / dev / volume_mount.dockerfile
1 # syntax=docker/dockerfile:experimental
2 FROM rust:1.47-buster as rust
3
4 ENV HOME=/home/root
5
6 WORKDIR /app
7
8 # Copy the source folders
9 COPY . ./
10
11 # Build for debug
12 RUN --mount=type=cache,target=/usr/local/cargo/registry \
13     --mount=type=cache,target=/app/target \
14     cargo build
15 RUN --mount=type=cache,target=/app/target \
16     cp target/debug/lemmy_server lemmy_server
17
18 FROM rust:1.47-buster as docs
19 WORKDIR /app
20 RUN cargo install mdbook --git https://github.com/Nutomic/mdBook.git \
21         --branch localization --rev 0982a82 --force
22 COPY docs ./docs
23 RUN mdbook build docs/
24
25 FROM ubuntu:20.10
26
27 # Install libpq for postgres and espeak
28 RUN apt-get update -y
29 RUN apt-get install -y libpq-dev espeak 
30
31 # Copy resources
32 COPY config/defaults.hjson /config/defaults.hjson
33 COPY --from=rust /app/lemmy_server /app/lemmy
34 COPY --from=docs /app/docs/book/ /app/documentation/
35
36 EXPOSE 8536
37 CMD ["/app/lemmy"]