Can now test with docker

This commit is contained in:
John Shaver 2019-09-25 00:45:54 -07:00
parent cc23074808
commit e4e6eb0f4f
5 changed files with 26 additions and 3 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
node_modules node_modules
.env

View file

@ -9,5 +9,6 @@ RUN haraka -i /app
RUN echo webmailer >> /app/config/plugins RUN echo webmailer >> /app/config/plugins
RUN echo "listen=[::0]:8080" >> /app/config/http.ini RUN echo "listen=[::0]:8080" >> /app/config/http.ini
RUN echo "listen=[::0]:2525" >> /app/config/smtp.ini RUN echo "listen=[::0]:2525" >> /app/config/smtp.ini
COPY testing/testTemplate.js /app/plugins/webmailer/templates/testTemplate.js COPY testing/testTemplate.js /app/templates
COPY . /app/plugins/webmailer
CMD haraka -c /app CMD haraka -c /app

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
version: '3'
services:
mail:
env_file:
- .env
build:
context: .
ports:
- '8080:8080'
- '2525:2525'
volumes:
- ./:/app/plugins/webmailer

View file

@ -2,11 +2,18 @@ let fs = require('fs');
let bodyParser = require('body-parser'); let bodyParser = require('body-parser');
let outbound; let outbound;
let getTemplates;
let getTemplates = require('./templates');
let errorSender = require('./errorSender'); let errorSender = require('./errorSender');
exports.register = function() { exports.register = function() {
outbound = this.haraka_require('./outbound'); outbound = this.haraka_require('./outbound');
try {
getTemplates = this.haraka_require('./templates');
if(!getTemplates || !Object.keys(getTemplates).length) {
throw Error ("No templates loaded!");
}
}catch(e) {
this.logerror("No email templates were loaded! Please add a templates directory with templates and try agin");
}
this.register_hook('init_http', 'initExpress'); this.register_hook('init_http', 'initExpress');
} }

1
templates/testTemplate.js Symbolic link
View file

@ -0,0 +1 @@
../testing/testTemplate.js