diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f80343d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +/node_modules +/static/feeds/* +!/static/feeds/.gitkeep +/static/alternate/* +!/static/alternate/.gitkeep diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..83d149d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:latest + +WORKDIR /kill-the-newsletter + +COPY package*.json ./ +RUN npm ci --production +COPY . . + +VOLUME /kill-the-newsletter/static/feeds/ +VOLUME /kill-the-newsletter/static/alternate/ + +ENV WEB_PORT=8000 +ENV EMAIL_PORT=2525 +ENV BASE_URL=http://localhost:8000 +ENV EMAIL_DOMAIN=localhost +ENV ISSUE_REPORT=mailto:kill-the-newsletter@leafac.com + +EXPOSE 8000 +EXPOSE 2525 + +CMD npx ts-node . diff --git a/README.md b/README.md index b84e9f5..4e9115d 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,16 @@ Install [Node.js](https://nodejs.org/) and run: ```console $ npm install-test ``` + +# Docker Support (Experimental) + +Install [Docker](https://www.docker.com/) and run: + +```console +$ docker build -t kill-the-newsletter . +$ docker run kill-the-newsletter +``` + +The web server will be running at `http://localhost:8000` and the email server at `smtp://localhost:2525`. + +For use in production, start with the example [`Dockerfile`](Dockerfile).