Skip to content

Commit 23d3ded

Browse files
authored
Merge pull request #390 from Stunkymonkey/start_postfix
start postfix at runtime if sendmail is used
2 parents a99c797 + 247e029 commit 23d3ded

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ RUN apk add --no-cache --update \
5050
postgresql \
5151
postgresql-client \
5252
sqlite \
53+
sudo \
5354
wget sqlite git curl bash grep \
5455
supervisor
5556

@@ -61,8 +62,12 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
6162

6263
RUN adduser -S -s /bin/bash -u 1001 -G root www-data
6364

65+
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD:SETENV: /usr/sbin/postfix" >> /etc/sudoers
66+
6467
RUN touch /var/run/nginx.pid && \
65-
chown -R www-data:root /var/run/nginx.pid /etc/php7/php-fpm.d
68+
chown -R www-data:root /var/run/nginx.pid
69+
70+
RUN chown -R www-data:root /etc/php7/php-fpm.d
6671

6772
RUN mkdir -p /var/www/html && \
6873
mkdir -p /usr/share/nginx/cache && \

entrypoint.sh

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ check_configured() {
6767
esac
6868
}
6969

70+
check_sendmail() {
71+
if [[ "${MAIL_DRIVER:-}" == "sendmail" ]]; then
72+
sudo /usr/sbin/postfix start
73+
fi
74+
}
75+
7076
initialize_system() {
7177
echo "Initializing Cachet container ..."
7278

@@ -231,6 +237,7 @@ start_system() {
231237
/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
232238
}
233239

240+
check_sendmail
234241
start_system
235242

236243
exit 0

0 commit comments

Comments
 (0)