Dockerfile 1.39 KB
Newer Older
1
FROM nginx
2

3 4
RUN apt -y update && apt -y install php-fpm \
    ca-certificates \
5
    cron \
6 7 8 9 10
    zip \
    php7.3-common \
    php7.3-curl \
    php7.3-mbstring \
    php7.3-sqlite3 \
Dominik Hebeler's avatar
Dominik Hebeler committed
11
    php7.3-mysql \
12 13 14 15 16
    php7.3-xml \
    php7.3-zip \
    php7.3-redis \
    php7.3-gd \
    redis-server
17

18 19 20 21 22 23
RUN sed -i 's/listen.owner = www-data/listen.owner = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
    sed -i 's/listen.group = www-data/listen.group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
    sed -i 's/user = www-data/user = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
    sed -i 's/group = www-data/group = nginx/g' /etc/php/7.3/fpm/pool.d/www.conf && \
    sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini && \
    mkdir /html
24

25 26 27
# Set correct timezone
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && dpkg-reconfigure -f noninteractive tzdata

28 29 30
# Add Cronjob for Laravel
RUN (crontab -l ; echo "* * * * * php /html/artisan schedule:run >> /dev/null 2>&1") | crontab

31 32
WORKDIR /html
EXPOSE 80
33

34 35
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/nginx-default.conf /etc/nginx/conf.d/default.conf
36
COPY --chown=root:nginx . /html
37
RUN chmod -R g+w storage bootstrap/cache
38

39
CMD /etc/init.d/cron start && \
40 41 42
    /etc/init.d/php7.3-fpm start && \
    /etc/init.d/nginx start && \
    /etc/init.d/redis-server start && \
43
    su -s /bin/bash -c 'php artisan requests:fetcher' nginx