-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
47 lines (36 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM php:7.4-alpine
LABEL maintainer="ipunkt Business Solutions <[email protected]>" \
version.image="v4.4" \
version.php=$PHP_VERSION \
description="A supervisor configured to run with laravel artisan queue:work or artisan horizon command"
ENV QUEUE_CONNECTION=redis
ENV QUEUE_NAME=default
ENV LARAVEL_HORIZON=false
RUN apk add --no-cache coreutils sqlite-dev libxml2-dev curl-dev gmp-dev icu-dev libpng-dev jpeg-dev freetype-dev autoconf imagemagick-dev gcc libc-dev libzip-dev rabbitmq-c-dev make libtool \
&& docker-php-ext-configure gd --with-freetype=/usr/include/freetype2 --with-jpeg=/usr/include \
&& docker-php-ext-install -j$(nproc) bcmath pdo pdo_mysql pdo_sqlite json xml zip curl gmp intl gd soap sockets pcntl \
&& pecl install imagick \
&& pecl install amqp \
&& pecl install redis \
&& docker-php-ext-enable imagick redis
ADD https://github.com/kelseyhightower/confd/releases/download/v0.10.0/confd-0.10.0-linux-amd64 /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd \
&& apk add --no-cache sqlite libxml2 curl gmp icu libpng jpeg freetype libzip imagemagick gcc ssmtp rabbitmq-c \
# Fix alpine iconv problems part 1
# See https://github.com/docker-library/php/issues/240
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community gnu-libiconv \
&& docker-php-ext-enable bcmath pdo pdo_mysql pdo_sqlite json xml zip curl gmp intl gd imagick soap amqp sockets
# Install pdo if you want to use database queue and install supervisor
RUN apk add --update supervisor && rm -rf /tmp/* /var/cache/apk/*
# Define working directory
WORKDIR /etc/supervisor/conf.d
# Use local configuration
COPY laravel-worker.conf.tpl /etc/supervisor/conf.d/laravel-worker.conf.tpl
COPY laravel-horizon.conf.tpl /etc/supervisor/conf.d/laravel-horizon.conf.tpl
COPY custom-php.ini.tpl /opt/etc/custom-php.ini.tpl
COPY supervisord-watchdog.py /opt/supervisord-watchdog.py
# Copy scripts
COPY init.sh /usr/local/bin/init.sh
VOLUME /var/www/app
# Run supervisor
ENTRYPOINT ["/bin/sh", "/usr/local/bin/init.sh"]