lemmy/docker/dev/Dockerfile

36 lines
782 B
Docker
Raw Normal View History

2020-10-24 09:23:45 -06:00
# syntax=docker/dockerfile:experimental
FROM rust:1.47-buster as rust
2019-04-10 12:10:57 -06:00
2020-10-24 09:23:45 -06:00
ENV HOME=/home/root
2020-09-02 09:42:48 -06:00
2020-10-24 09:23:45 -06:00
WORKDIR /app
2020-09-02 09:42:48 -06:00
2020-10-24 09:23:45 -06:00
# Copy the source folders
2020-10-27 09:57:40 -06:00
COPY . ./
2019-04-10 12:10:57 -06:00
2020-06-12 07:29:50 -06:00
# Build for debug
2020-10-24 09:23:45 -06:00
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
2020-01-01 10:01:49 -07:00
2020-10-27 09:57:40 -06:00
FROM peaceiris/mdbook:v0.3.7 as docs
2020-01-01 10:01:49 -07:00
WORKDIR /app
COPY docs ./docs
RUN mdbook build docs/
2020-10-27 09:57:40 -06:00
FROM ubuntu:20.10
2020-10-27 09:57:40 -06:00
# 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
2020-10-24 09:23:45 -06:00
COPY --from=rust /app/lemmy_server /app/lemmy
COPY --from=docs /app/docs/book/ /app/documentation/
EXPOSE 8536
CMD ["/app/lemmy"]