aboutsummaryrefslogtreecommitdiff
path: root/app/build/plume/Dockerfile
blob: 9199e1e4f756446fadbcda8ad2a41cb741f6f91d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM rust:1.47.0-slim-buster as builder

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
RUN git clone -n https://git.deuxfleurs.fr/Deuxfleurs/plume.git

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
RUN cargo install --no-default-features --features postgres -f --path .
# cli
RUN cargo install --no-default-features --features postgres --path plume-cli
RUN cargo clean

#-----------------------------
FROM debian:bullseye-slim

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"]

EXPOSE 7878