1 # syntax=docker/dockerfile:experimental
3 # Warning: this will not pick up migrations unless there are code changes
4 FROM rust:1.50-buster as rust
10 # Copy the source folders
12 RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
15 RUN --mount=type=cache,target=/usr/local/cargo/registry \
16 --mount=type=cache,target=/app/target \
18 RUN --mount=type=cache,target=/app/target \
19 cp target/debug/lemmy_server lemmy_server
23 # Install libpq for postgres
25 RUN apt-get install -y libpq-dev
28 COPY --from=rust /app/lemmy_server /app/lemmy