diff options
| author | Joe Carstairs <me@joeac.net> | 2025-12-18 13:13:34 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2025-12-18 13:13:34 +0000 |
| commit | 8f95c6ff74d6d223882397cb981f2e670f237253 (patch) | |
| tree | 809e5c663a013581187cee1362581408551f6ded | |
| parent | 9d8d2a266a130d928a4f3aba83caad962f4b86b1 (diff) | |
WIP: Dockerise with sendmail
| -rw-r--r-- | Dockerfile | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -1,12 +1,39 @@ FROM node:lts AS runtime WORKDIR /app -COPY . . +################### TODO ################### +# - Refactor this Dockerfile into a compose.yml +# - Add another service on the same network running an SMTP server such +# as msmtpd or Postfix +# - Configure the SMTP server to send emails from me@joeac.net via Zoho +# - Configure the website to use the SMTP server to send emails +# - Test +# - Push +# - Test on RPi +# - Consider: now you're running an SMTP server anyway, can you send it +# from your very own no-reply email address? +############################################ +COPY package.json . +COPY website/db website/astro.config.mjs website/ +ARG DB_URL=file:/app/db.sqlite +ENV ASTRO_DB_REMOTE_URL=$DB_URL +RUN mkdir -p "$(dirname "$(echo "$ASTRO_DB_REMOTE_URL" | cut -d':' -f 2)")" +RUN npm run astro db push + +COPY ./website ./website RUN npm install RUN npm run build +ARG MAX_DAILY_EMAILS="100" +ARG SENDMAIL_BIN="/usr/sbin/sendmail" + ENV HOST=0.0.0.0 ENV PORT=4321 + EXPOSE 4321 -CMD ["node", "./website/dist/server/entry.mjs"] +CMD [ \ + "MAX_DAILY_EMAILS=$MAX_DAILY_EMAILS", \ + "SENDMAIL_BIN=$SENDMAIL_BIN", \ + "node", \ + "./website/dist/server/entry.mjs"] |
