1
0

multi-stages dockerfile, still big but way better

This commit is contained in:
2021-01-28 12:42:21 +01:00
parent 3b443c2001
commit 57249618c0

View File

@ -13,37 +13,33 @@ COPY core ./core/
RUN go build -o gogodiscordo RUN go build -o gogodiscordo
FROM ubuntu:focal FROM alpine as alpine_voices
WORKDIR /tmp
RUN wget --no-check-certificate https://github.com/numediart/MBROLA-voices/archive/master.zip \
&& unzip master.zip && rm master.zip
FROM ubuntu:focal as ubuntu1
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
RUN set -ex;\ RUN set -ex;\
apt update apt update && \
RUN set -ex;\
apt install -y --no-install-recommends \ apt install -y --no-install-recommends \
mbrola \ mbrola \
espeak-ng \ espeak-ng \
wget \ ffmpeg \
unzip; ca-certificates \
&& apt-get clean \
RUN wget --no-check-certificate https://github.com/numediart/MBROLA-voices/archive/master.zip && rm -rf /var/lib/apt/lists/*
RUN unzip master.zip
RUN mkdir -p /usr/share/mbrola/
RUN cp -r MBROLA-voices-master/data/* /usr/share/mbrola/
COPY --from=builder /src/gogodiscordo /app/ COPY --from=builder /src/gogodiscordo /app/
COPY core/ app/core COPY config.yaml /app/
RUN mkdir -p /usr/share/mbrola/
COPY --from=alpine_voices /tmp/MBROLA-voices-master/data/fr* /usr/share/mbrola/
VOLUME ["/app"] VOLUME ["/app"]
RUN useradd -d /app appuser RUN useradd -d /app appuser
RUN apt install -y ca-certificates
RUN apt install -y --no-install-recommends ffmpeg
COPY config.yaml /app/
RUN rm master.zip
RUN apt clean -y
WORKDIR /app WORKDIR /app
CMD ["./gogodiscordo"] CMD ["./gogodiscordo"]