forked from ipunkt/docker-laravel-queue-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (27 loc) · 1.02 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
FROM php:7.2-alpine
LABEL maintainer="Patrik Forsberg <[email protected]>" \
version.image="v3.3" \
version.php=$PHP_VERSION \
description="A supervisor configured to run with laravel artisan queue:work or artisan horizon command"
ENV PYTHON_VERSION=2
ENV PY_PIP_VERSION=2
ENV SUPERVISOR_VERSION=3.3.3
ENV QUEUE_CONNECTION=redis
ENV QUEUE_NAME=default
ENV LARAVEL_HORIZON=false
ENV LARAVEL_HOME="/var/www"
# Install pdo if you want to use database queue
RUN docker-php-ext-install pdo pdo_mysql pcntl posix
# Install supervisor
RUN apk update && apk add -u python$PYTHON_VERSION py$PY_PIP_VERSION-pip
RUN pip install supervisor==$SUPERVISOR_VERSION
# 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 scripts
COPY init.sh /usr/local/bin/init.sh
VOLUME /var/www
# Run supervisor
ENTRYPOINT ["/bin/sh", "/usr/local/bin/init.sh"]