]> Untitled Git - lemmy.git/blob - docker/dev/volume_mount.dockerfile
Trying out cargo chef and a travis docker image cache. (#1238)
[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 peaceiris/mdbook:v0.3.7 as docs
19 WORKDIR /app
20 COPY docs ./docs
21 RUN mdbook build docs/
22
23 FROM ubuntu:20.10
24
25 # Install libpq for postgres and espeak
26 RUN apt-get update -y
27 RUN apt-get install -y libpq-dev espeak 
28
29 # Copy resources
30 COPY config/defaults.hjson /config/defaults.hjson
31 COPY --from=rust /app/lemmy_server /app/lemmy
32 COPY --from=docs /app/docs/book/ /app/documentation/
33
34 EXPOSE 8536
35 CMD ["/app/lemmy"]