protonmail-bridge/Dockerfile

39 lines
884 B
Docker

# Build the ProtonMail Bridge.
FROM golang:1.14-alpine as build
ENV LANG C.UTF-8
RUN apk add --no-cache \
gcc \
git \
libsecret-dev \
make \
musl-dev
WORKDIR /usr/src
ARG TAG
RUN git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge \
&& cd proton-bridge \
&& if [ -n "$TAG" ]; then echo "Using tags/$TAG..."; git checkout tags/$TAG; fi \
&& make build-nogui
# Create a container for the ProtonMail Bridge.
FROM alpine:edge
ENV LANG C.UTF-8
EXPOSE 25/tcp
EXPOSE 143/tcp
COPY --from=build /usr/src/proton-bridge/Desktop-Bridge /bin/protonmail-bridge
COPY entrypoint /bin/
COPY initproton /bin/
RUN apk add --no-cache \
libsecret \
pass \
socat \
su-exec \
&& chmod +x /bin/entrypoint \
&& chmod +x /bin/initproton
WORKDIR /var/lib/proton
ENTRYPOINT ["/bin/entrypoint"]
CMD ["/bin/initproton"]