Giter VIP home page Giter VIP logo

docker's Introduction

Build Status

Building

  • Clone this repo ( git clone https://github.com/postfixadmin/docker.git docker ) and then run :
  • docker build --pull --rm -t postfixadmin-image <VARIANT> from within the created directory (where <VARIANT> is replaced by apache, fpm or fpm-alpine)

Image Variants

The following variant are currently provided:

apache

This starts an Apache webserver with PHP, so you can use postfixadmin out of the box.

fpm-alpine

This image has a very small footprint. It is based on Alpine Linux and starts only a PHP FPM process. Use this variant if you already have a seperate webserver.

If you need more tools, that are not available on Alpine Linux, use the fpm image instead.

fpm

This image is based on Debian and starts only a PHP FPM container.

Use this variant if you already have a seperate webserver.

Running

Some knowledge of Postixadmin is assumed.

Advanced users will probably want to specify a custom configuration (config.local.php file).

If you're just trying out the software, there's probably no need for a config.local.php file.

No config.local.php / no existing setup

You have two options :

  • Use a default sqlite database, or
  • Use an external database (MySQL, PgSQL etc).

You can configure this through the following environment variables when running the docker container.

  • POSTFIXADMIN_DB_TYPE=... - sqlite, mysqli, pgsql
  • POSTFIXADMIN_DB_NAME=.... - database name or path to database file (sqlite)
  • POSTFIXADMIN_DB_USER=... - mysqli/pgsql only (db server user name)
  • POSTFIXADMIN_DB_PASSWORD=... - mysqli/pgsql only (db server user password)
  • POSTFIXADMIN_SETUP_PASSWORD=... - generated from setup.php, default is topsecret99

Note: An SQLite database is probably not recommended for production use, but is a quick and easy way to try out the software without dependencies.

Example docker run

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

Existing setup / with config.local.php

Postfixadmin's default configuration is stored in a config.inc.php file (see https://github.com/postfixadmin/postfixadmin/blob/master/config.inc.php ).

To customise, copy this file, remove everything you don't want to override, and call it config.local.php.

docker run -v /local/path/to/config.local.php:/var/www/html/config.local.php \
           --name postfixadmin \
           -p 8080:80 \
           postfixadmin-image

Next Steps

Once the container is running, try visiting :

Docker Compose

Try something like the below in a docker-compose.yml file; changing the usernames/passwords as required.

Then run : docker-compose up

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

docker's People

Contributors

j0wi avatar davidgoodwin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.