The following tools are required for a proper deployment:
- Docker with Docker Swarm mode enabled.
- traefik with a minimum version of v2.0
- The traefik should be configured to get let's encrypt certificates automatically
Allow SMTP ports for outgoing requests
It's very important to allow outgoing requests on common SMTP port like 25, 2525, 465, 587. But you also have to make sure, that a malicious user can't connect to any other server in your current infrastructure.
First of all, create the following file:
docker-compose.yml and paste the
Run the following lines to create a new docker-compose.yml file:
curl https://gitlab.com/aakado/formail/raw/master/docker-compose.prod.yml > docker-compose.yml
Change the default values:
formail.dev with your domain everywhere in the
Set the environment variables:
Inspect all environment variables in the
docker-compose.yml file and change them according to your needs.
You have to generate a new APP_KEY for security reasons. Run
php artisan key:generate --show to generate a new one and copy the output. If you don't have laravel running locally or in a docker container, you can get a key with the following command instead:
docker run --entrypoint php registry.gitlab.com/aakado/formail:dev-latest artisan key:generate --show.
Put the environment variables into a separated
If you do not want to put your environment variables directly into the
docker-compose.yml file, you can also put them into a separate
.env file as key-value pairs.
First create a copy of the .env.example file:
curl https://gitlab.com/aakado/formail/raw/master/.env.example > .env
Then you have to link the file to the service like this:
env_file: - .env
Now you can deploy the stack:
docker stack deploy -c docker-compose.yml formail