Skip to content
Snippets Groups Projects
Commit 71c21ad9 authored by Dariusz Janny's avatar Dariusz Janny
Browse files

Merge branch 'master' into 'master'

[#1] prepare image

See merge request !1
parents a9ad9514 cdcc41b2
No related branches found
No related tags found
1 merge request!1[#1] prepare image
FROM alpine:3.12.3
RUN apk add --no-cache bash postfix supervisor rsyslog busybox-extras
COPY /conf/etc/supervisord.conf /etc/supervisord.conf
COPY /scripts/docker/run.sh /run.sh
EXPOSE 587
CMD [ "/bin/sh", "-c", "/run.sh" ]
# FaaS-SMTP # FaaS-SMTP
## structure
`_conf/`_ - directory with configuration files
`scripts/` - directory with utils and scripts
## build image
To build `faas-smtp` docker image
`
cd scripts/helpers && ./build.sh
`
## run image
To run `faas-smtp` docker image
`
cd scripts/helpers && ./run.sh
`
[supervisord]
user = root
nodaemon = true
logfile = /dev/null
logfile_maxbytes= 0
[program:rsyslog]
command = rsyslogd -n
autostart = true
autorestart = true
startsecs = 2
stopwaitsecs = 2
stdout_logfile = /dev/stdout
stderr_logfile = /dev/stderr
stdout_logfile_maxbytes = 0
stderr_logfile_maxbytes = 0
[program:postfix]
command = /usr/sbin/postfix -c /etc/postfix start-fg
autostart = true
autorestart = false
directory = /etc/postfix
startsecs = 0
version: '3.1'
services:
smtp:
image: ${FAAS_SMTP_IMAGE}
build:
context: ../
dockerfile: Dockerfile
restart: always
environment:
- FAAS_SMTP_MYHOSTNAME=${FAAS_SMTP_MYHOSTNAME}
- FAAS_SMTP_INET_INTERFACES=${FAAS_SMTP_INET_INTERFACES}
ports:
- "${FAAS_SMTP_PORT}:25"
FAAS_SMTP_IMAGE=faas/faas-smtp:1.0-SNAPSHOT
FAAS_SMTP_MYHOSTNAME=test.faas.geant.net
FAAS_SMTP_INET_INTERFACES=all
FAAS_SMTP_PORT=2025
#! /bin/bash
# set -x
sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
function update_postfix_config_value() {
local key=${1}
local value=${2}
local cfg_file=${3:-/etc/postfix/main.cf}
[ "${key}" == "" ] && echo "ERROR: Key is not set" && exit 1
[ "${value}" == "" ] && echo "ERROR:value is not set" && exit 1
echo "Setting configuration option ${key} with value: ${value}"
postconf -e "${key} = ${value}"
}
[ -z "${FAAS_SMTP_MYHOSTNAME}" ] && echo "FAAS_SMTP_MYHOSTNAME is not set" && exit 1
[ -z "${FAAS_SMTP_INET_INTERFACES}" ] && echo "FAAS_SMTP_INET_INTERFACES is not set" && exit 1
update_postfix_config_value "myhostname" ${FAAS_SMTP_MYHOSTNAME}
update_postfix_config_value "inet_interfaces" ${FAAS_SMTP_INET_INTERFACES}
rm -f /var/spool/postfix/pid/master.pid
exec supervisord -c /etc/supervisord.conf
#! /bin/bash
docker-compose --env-file ../../conf/faas-smtp.env -f ../../conf/faas-smtp.compose.yml build
#! /bin/bash
docker-compose --env-file ../../conf/faas-smtp.env -f ../../conf/faas-smtp.compose.yml up
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment