infrastructure/app/build/plume/Dockerfile

55 lines
1.2 KiB
Text
Raw Normal View History

2020-10-14 19:27:43 +00:00
FROM rust:1.47.0-slim-buster as builder
2020-10-01 13:25:04 +00:00
RUN apt-get update && \
apt-get install -y \
pkg-config \
git \
curl \
postgresql \
postgresql-contrib \
libpq-dev \
gettext \
git \
curl \
gcc \
make \
openssl \
libssl-dev \
libclang-dev
ARG VERSION
WORKDIR /opt
2021-01-07 10:09:29 +00:00
RUN git clone -n https://git.joinplu.me/Plume/Plume.git plume
2020-10-01 13:25:04 +00:00
WORKDIR /opt/plume
RUN git checkout ${VERSION}
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
# frontend
RUN cargo install cargo-web
RUN cargo web deploy -p plume-front --release
# backend
2020-10-14 19:27:43 +00:00
RUN cargo install --no-default-features --features postgres -f --path .
2020-10-01 13:25:04 +00:00
# cli
RUN cargo install --no-default-features --features postgres --path plume-cli
2020-10-14 19:27:43 +00:00
RUN cargo clean
2020-10-01 13:25:04 +00:00
2020-10-14 19:27:43 +00:00
#-----------------------------
FROM debian:bullseye-slim
2020-10-01 13:25:04 +00:00
2020-10-14 19:27:43 +00:00
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libpq5 \
libssl1.1
WORKDIR /app
COPY --from=builder /opt/plume /app
COPY --from=builder /usr/local/cargo/bin/diesel /usr/local/bin/
COPY --from=builder /usr/local/cargo/bin/plm /usr/local/bin/
COPY --from=builder /usr/local/cargo/bin/plume /usr/local/bin/
COPY plm-start /usr/local/bin/
CMD ["plm-start"]