前置条件
- 为系统安装docker 和docker-compose组件
apt-get install docker -y
apt-get install docker-compose -y
- 新建docker-compose文件
vi docker-compose.txt
- 粘贴下面的文本并保存
version: '2.3'
services:
portainer:
image: "ewomail/ewomail"
container_name: "ewomail"
hostname: "mail.yourdomain.com"
restart: always
ports:
- "0.0.0.0:2210:22"
- "0.0.0.0:25:25"
- "0.0.0.0:109:109"
- "0.0.0.0:110:110"
- "0.0.0.0:143:143"
- "0.0.0.0:465:465"
- "0.0.0.0:587:587"
- "0.0.0.0:993:993"
- "0.0.0.0:995:995"
- "0.0.0.0:8000:8000"
- "0.0.0.0:8010:8010"
- "0.0.0.0:8020:8020"
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
privileged: true
tty: true
stdin_open: true
- 开始安装ewomail,输入命令
mv docker-compose.txt docker-compose.yml
docker-compose -f docker-compose.yml up -d
- 邮箱后台默认账号admin,密码ewomail123,管理员地址 http://ip:8010/
ewomail容器重启所需命令
docker restart ewomail
docker exec -it ewomail bash
rm /ewomail/apache/logs/httpd.pid
service httpd start