Dockerfile 1.38 KB
Newer Older
Dominik Hebeler's avatar
Dominik Hebeler committed
1
FROM nginx
Phil Höfer's avatar
Phil Höfer committed
2

Dominik Hebeler's avatar
Dominik Hebeler committed
3
4
RUN apt -y update && apt -y install php-fpm \
    ca-certificates \
Dominik Hebeler's avatar
Dominik Hebeler committed
5
    cron \
Dominik Hebeler's avatar
Dominik Hebeler committed
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 \
Dominik Hebeler's avatar
Dominik Hebeler committed
12
13
14
15
16
    php7.3-xml \
    php7.3-zip \
    php7.3-redis \
    php7.3-gd \
    redis-server
Phil Höfer's avatar
Phil Höfer committed
17

Dominik Hebeler's avatar
Dominik Hebeler committed
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
Phil Höfer's avatar
Phil Höfer committed
24

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

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

Dominik Hebeler's avatar
Dominik Hebeler committed
31
32
WORKDIR /html
EXPOSE 80
Phil Höfer's avatar
Phil Höfer committed
33

Dominik Hebeler's avatar
Dominik Hebeler committed
34
35
36
COPY config/nginx.conf /etc/nginx/nginx.conf
COPY config/nginx-default.conf /etc/nginx/conf.d/default.conf
COPY . /html
Phil Höfer's avatar
Phil Höfer committed
37

38
39
40
41
CMD /etc/init.d/cron start && \
    /etc/init.d/php7.3-fpm start && \
    /etc/init.d/nginx start && \
    /etc/init.d/redis-server start && \
Dominik Hebeler's avatar
Dominik Hebeler committed
42
    chmod -R 0777 /html/storage && \
Dominik Hebeler's avatar
Dominik Hebeler committed
43
    chmod -R 0777 /html/bootstrap/cache && \
44
    php artisan worker:spawner