Added files for the docker image

This commit is contained in:
Daniel Mowitz 2023-08-24 17:58:27 +02:00
parent b44e94d312
commit cfd0c39e2d
2 changed files with 30 additions and 0 deletions

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM rust:1.69-alpine
RUN mkdir webmention-filer
COPY src webmention-filer/src
COPY Cargo.toml webmention-filer/Cargo.toml
COPY Cargo.lock webmention-filer/Cargo.lock
WORKDIR webmention-filer
RUN cargo build --release
FROM alpine
COPY /target/release/webmention-filer /usr/bin/
RUN apk add mailx
USER 1000:1000
EXPOSE 8000
ENTRYPOINT ["/usr/bin/mk-to-atom"]

10
send-daily-mail.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
yesterday=`date -d 'yesterday' --iso-8601`
echo "/tmp/webmention-storage/$yesterday"
if [ -f "/tmp/webmention-storage/$yesterday" ]
then
cat "/tmp/webmention-storage/$yesterday" | mail -r $SENDER -s "Your webmentions for $yesterday" $RECIPIENT
fi