0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00
postfixadmin/docker
dryware-fr e4bfae260b
Typo correction
There was a typo in the script, rendering a TCP connection to MySQL or Postgres impossible.
2018-01-19 17:26:56 +01:00
..
docker-entrypoint.sh Typo correction 2018-01-19 17:26:56 +01:00
Dockerfile variables for docker 2017-11-26 19:59:17 +00:00
README.md add example docker compose settings 2017-11-13 20:07:44 +00:00

Building

cd docker ; docker build --pull --rm -t postfixadmin-image .

Running

No config.local.php / no existing setup

If you do not have a config.local.php, then we fall back to look for environment variables to generate one.

POSTFIXADMIN_DB_TYPE can be one of :

  • mysqli
  • pgsql
  • sqlite
docker run -e POSTFIXADMIN_DB_TYPE=mysqli \
           -e POSTFIXADMIN_DB_HOST=whatever \
           -e POSTFIXADMIN_DB_USER=user \
           -e POSTFIXADMIN_DB_PASSWORD=topsecret \
           -e POSTFIXADMIN_DB_NAME=postfixadmin \
           --name postfixadmin \
           -p 8080:80 \
        postfixadmin-image

Note: An sqlite database is used as a fallback if you do not have a config.local.php and do not specify the above variables.

Existing config.local.php

docker run --name postfixadmin -p 8080:80 postfixadmin-image

Docker Compose

Try something like the below; changing the usernames/passwords as required.

version: '3'

services:
   db:
     image: mysql:5.7
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: notSecureChangeMe
       MYSQL_DATABASE: postfixadmin
       MYSQL_USER: postfixadmin
       MYSQL_PASSWORD: postfixadminPassword

   postfixadmin:
     depends_on:
       - db
     image: postfixadmin-image:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       POSTFIXADMIN_DB_TYPE: mysqli
       POSTFIXADMIN_DB_HOST: db
       POSTFIXADMIN_DB_USER: postfixadmin
       POSTFIXADMIN_DB_NAME: postfixadmin
       POSTFIXADMIN_DB_PASSWORD: postfixadminPassword