Browse Source

official images

master
ale 7 months ago
parent
commit
b03969e1eb
6 changed files with 34 additions and 28 deletions
  1. +0
    -2
      .env
  2. +6
    -2
      README.md
  3. +7
    -8
      docker-compose.yml
  4. +2
    -0
      entrypoint.sh
  5. +8
    -5
      webmail/Dockerfile
  6. +11
    -11
      wildduck/Dockerfile

+ 0
- 2
.env

@ -1,2 +0,0 @@
DOMAIN=domain.com
REVERSE_DNS=com.domain

+ 6
- 2
README.md

@ -2,12 +2,12 @@
## Instalar
- Ejecutar: `./start.sh` <dominio> - Configura los certificados en la carpeta ./secure
- Editar `.env` con el valor del dominio
- Editar `docker-compose.yml` con el valor del dominio de `DOMAIN` y `REVERSE_DNS`
## Arrancar
- Instalar `docker` y `docker-compose`
- Ejecutar: docker-compose up -d
- Abrir el navegador http://webmail:3000
- Abrir el navegador http://webmail.domain.com o http://webmail:3000
## Persistencia
- Ejecutar: docker cp mongo:/data/db ./mongodb && chown -R 999.999 ./mongodb
@ -15,6 +15,10 @@
- Descomentar las lineas del archivo `docker-compose.yml`
- Ejecutar: docker-compose down && docker-compose up -d
## Docker
- docker pull manalejandro/haraka-wildduck_wildduck
- docker pull manalejandro/haraka-wildduck_webmail
### Licencia
- MIT

+ 7
- 8
docker-compose.yml

@ -1,14 +1,13 @@
version: '3'
services:
wildduck:
build:
context: ./wildduck
args:
DOMAIN: $DOMAIN
REVERSE_DNS: $REVERSE_DNS
build: ./wildduck
hostname: wildduck
container_name: wildduck
restart: always
environment:
- DOMAIN=domain.com
- REVERSE_DNS=com.domain
entrypoint:
- /bin/bash
- /entrypoint.sh
@ -57,7 +56,7 @@ services:
build:
context: ./webmail
args:
DOMAIN: $DOMAIN
- DOMAIN=domain.com
hostname: webmail
container_name: webmail
restart: always
@ -65,8 +64,8 @@ services:
- node
- server.js
- --config=/webmail/config/default.toml
ports:
- "3000:3000/tcp"
expose:
- 3000
depends_on:
- redis
- mongo

+ 2
- 0
entrypoint.sh

@ -1,4 +1,6 @@
#!/bin/bash
find /haraka/config /wildduck/config /wildduck-mta/config -type f -exec \
sed -i -e "s/{{DOMAIN}}/$DOMAIN/g" -e "s/{{REVERSE_DNS}}/$REVERSE_DNS/g" {} +
cd /haraka
node haraka.js &
cd /wildduck

+ 8
- 5
webmail/Dockerfile

@ -1,6 +1,8 @@
FROM node:8-slim
ARG DOMAIN
RUN apt update && apt -y install git python make
FROM node:10-slim
LABEL version=1.0.0
LABEL description="Haraka-Wildduck Docker Mail Server"
LABEL maintainer="ale@hatthieves.es"
RUN apt update && apt -y install git python make && apt clean
RUN git clone https://github.com/nodemailer/wildduck-webmail /webmail
WORKDIR /webmail
RUN git checkout 5c54625a8b192823184ba7f5da41f3414e76db94
@ -8,6 +10,7 @@ COPY ./config /webmail/config
COPY ./views /webmail/views
RUN chown node.node -R /webmail
USER node
RUN npm install
ARG DOMAIN
RUN npm i
RUN npm run bowerdeps
RUN find ./config ./views -type f -exec sed -i "s/{{DOMAIN}}/$DOMAIN/g" {} +
RUN find /webmail/config /webmail/views -type f -exec sed -i "s/{{DOMAIN}}/$DOMAIN/g" {} +

+ 11
- 11
wildduck/Dockerfile

@ -1,7 +1,8 @@
FROM node:10-slim
ARG DOMAIN
ARG REVERSE_DNS
RUN apt update && apt -y install git python make g++ libcap2-bin
LABEL version=1.0.0
LABEL description="Haraka-Wildduck Docker Mail Server"
LABEL maintainer="ale@hatthieves.es"
RUN apt update && apt -y install git python make g++ libcap2-bin && apt clean
RUN git clone https://github.com/nodemailer/wildduck /wildduck
RUN git clone https://github.com/zone-eu/zone-mta-template /wildduck-mta
RUN git clone https://github.com/haraka/Haraka /haraka
@ -11,14 +12,13 @@ COPY ./wildduck-mta/config /wildduck-mta/config
RUN chown node.node -R /wildduck /wildduck-mta /haraka
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
USER node
ENV DOMAIN=$DOMAIN REVERSE_DNS=$REVERSE_DNS
WORKDIR /wildduck
RUN npm install --production
RUN npm i --production
WORKDIR /wildduck-mta
RUN npm install --production
RUN npm install zonemta-wildduck -S
RUN npm install zonemta-limiter -S
RUN npm i --production
RUN npm i -S zonemta-wildduck
RUN npm i -S zonemta-limiter
WORKDIR /haraka
RUN npm install
RUN npm install haraka-plugin-wildduck -S
RUN find ../haraka/config ../wildduck/config ../wildduck-mta/config -type f -exec sed -i "s/{{DOMAIN}}/$DOMAIN/g" {} +
RUN find ../haraka/config ../wildduck/config ../wildduck-mta/config -type f -exec sed -i "s/{{REVERSE_DNS}}/$REVERSE_DNS/g" {} +
RUN npm i
RUN npm i -S haraka-plugin-wildduck -S

Loading…
Cancel
Save