Merge branch 'docker'

This commit is contained in:
Leandro Facchinetti 2020-07-24 13:08:15 +01:00
commit b9907a8021
3 changed files with 39 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
/node_modules
/static/feeds/*
!/static/feeds/.gitkeep
/static/alternate/*
!/static/alternate/.gitkeep

21
Dockerfile Normal file
View File

@ -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 .

View File

@ -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).