Added docker-compose files.

This commit is contained in:
Juan Luis Baptiste 2018-03-06 01:24:32 -05:00
parent 58f40b3cab
commit cb4877eb4f
3 changed files with 27 additions and 3 deletions

View File

@ -8,7 +8,11 @@ Clone this repo and then:
cd docker-Postfix
sudo docker build -t postfix .
You can also find a prebuilt docker image from [Docker Hub](https://registry.hub.docker.com/u/juanluisbaptiste/postfix/), which can be pulled with this command:
Or you can use the provided [docker-compose](https://github.com/juanluisbaptiste/docker-postfix/blob/master/docker-compose.yml) files:
sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
For more information on using multiple compose files [see here](https://docs.docker.com/compose/production/). You can also find a prebuilt docker image from [Docker Hub](https://registry.hub.docker.com/u/juanluisbaptiste/postfix/), which can be pulled with this command:
sudo docker pull juanluisbaptiste/postfix:latest
@ -39,6 +43,9 @@ If you are going to use this container from other docker containers then it's be
-e SERVER_HOSTNAME=helpdesk.mycompany.com \
juanluisbaptiste/postfix
Or if you can start the service using the provided [docker-compose](https://github.com/juanluisbaptiste/docker-postfix/blob/master/docker-compose.yml) file for production use:
sudo docker-compose up -d
#### A note about using gmail as a relay

6
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,6 @@
version: '2'
services:
postfix:
build:
context: .
dockerfile: Dockerfile

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '2'
services:
postfix:
image: juanluisbaptiste/postfix:latest
expose:
- "25"
env_file:
- ../../credentials-smtp.env
restart: always
volumes:
- "/etc/localtime:/etc/localtime:ro"