-
Notifications
You must be signed in to change notification settings - Fork 2
/
only_worker.Dockerfile
46 lines (34 loc) · 1.12 KB
/
only_worker.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
ARG PHP_VERSION
ARG WORKER
FROM serversideup/php:${PHP_VERSION}-fpm-nginx as base
# copy Application
WORKDIR /var/www/html/
COPY ./src ./
# copy Application Environment
ARG LARAVEL_ENV
ENV LARAVEL_ENV=${LARAVEL_ENV}
RUN echo $LARAVEL_ENV > encoded-env
RUN base64 -d encoded-env > .env
RUN rm encoded-env
# Overide permission
RUN chown -R webuser:webgroup ./
RUN chmod -R 775 storage/
# install vendor
RUN composer install --optimize-autoloader --no-interaction --no-plugins --no-scripts --prefer-dist --no-dev
# Horizon
FROM base as queuehorizon
WORKDIR /var/www/html/
RUN mkdir -p /etc/s6-overlay/s6-rc.d/horizon
COPY ./horizon /etc/s6-overlay/s6-rc.d/horizon/run
RUN echo "longrun" > /etc/s6-overlay/s6-rc.d/horizon/type
RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/horizon
# Worker
FROM base as queueworker
WORKDIR /var/www/html/
RUN mkdir -p /etc/s6-overlay/s6-rc.d/worker
COPY ./worker /etc/s6-overlay/s6-rc.d/worker/run
RUN echo "longrun" > /etc/s6-overlay/s6-rc.d/worker/type
RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/worker
FROM queue${WORKER} as final
WORKDIR /var/www/html/
RUN chmod -R 755 /etc/s6-overlay/