47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
# ================================
|
||
# Compile Stage
|
||
# ================================
|
||
|
||
FROM debian:bookworm-slim AS compile
|
||
|
||
RUN <<EOF
|
||
apt update
|
||
apt install -y clang
|
||
apt clean
|
||
EOF
|
||
|
||
WORKDIR /src/
|
||
COPY src .
|
||
RUN clang -O2 -o /usr/local/bin/log /src/log/log.c
|
||
|
||
# ================================
|
||
# Build Stage
|
||
# ================================
|
||
|
||
FROM debian:bookworm-slim AS build
|
||
|
||
WORKDIR /
|
||
|
||
# Install dependencies
|
||
COPY target/scripts/build/packages.sh /build/
|
||
RUN /bin/bash /build/packages.sh && rm -r /build
|
||
|
||
# Install compiled binaries
|
||
COPY --from=compile /usr/local/bin/log /usr/local/bin/log
|
||
|
||
# Install helper scripts
|
||
COPY target/scripts/*.sh /usr/local/bin/
|
||
RUN chmod +x /usr/local/bin/*
|
||
COPY target/scripts/helpers /usr/local/bin/helpers
|
||
|
||
# Supervisor
|
||
COPY target/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
|
||
COPY target/supervisor/conf.d/* /etc/supervisor/conf.d/
|
||
|
||
# Dovecot
|
||
COPY target/dovecot/*.inc target/dovecot/*.conf /etc/dovecot/conf.d/
|
||
|
||
EXPOSE 25/tcp 143/tcp 465/tcp 993/tcp
|
||
|
||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|