diff options
| author | Joe Carstairs <me@joeac.net> | 2025-12-18 16:29:06 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2025-12-18 16:29:06 +0000 |
| commit | 9c50e749048f8e1c918d1abf2ca9713410f28816 (patch) | |
| tree | bca23942e94e519f76201d98027c9745496cd6ad /website/Dockerfile | |
| parent | b0be9fae2f062524f6a37fc1c1206701fdef08c7 (diff) | |
Move website root to website/
Diffstat (limited to 'website/Dockerfile')
| -rw-r--r-- | website/Dockerfile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/website/Dockerfile b/website/Dockerfile new file mode 100644 index 0000000..3984228 --- /dev/null +++ b/website/Dockerfile @@ -0,0 +1,39 @@ +FROM node:lts AS runtime +WORKDIR /app + +################### 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 package-lock.json ./ +RUN npm install + +COPY astro.config.mjs ./ +COPY db ./db/ +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 . . +RUN npm run build + +ARG MAX_DAILY_EMAILS="100" +ENV MAX_DAILY_EMAILS=$MAX_DAILY_EMAILS +ARG SENDMAIL_BIN="/usr/sbin/sendmail" +ENV SENDMAIL_BIN=$SENDMAIL_BIN + +ENV HOST=0.0.0.0 +ENV PORT=4321 + +EXPOSE 4321 +CMD ["node", "./dist/server/entry.mjs"] |
