-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile
136 lines (123 loc) · 3.11 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
FROM surnet/alpine-wkhtmltopdf:3.13.5-0.12.6-full as wkhtmltopdf
FROM node:14.17.6-alpine3.14 as base
WORKDIR /srv/http/www/invoiceneko/
# Essentials
RUN echo "UTC" > /etc/timezone
RUN apk add --no-cache \
zip \
unzip \
curl \
sqlite \
nginx \
supervisor \
git \
g++ \
make \
bash \
zlib-dev \
libpng-dev \
autoconf \
automake \
libtool \
tiff \
jpeg \
zlib \
pkgconf \
nasm \
file \
gcc \
musl-dev \
libltdl \
python2 \
xvfb \
xvfb-run \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
dbus \
screen \
chromium \
chromium-chromedriver
RUN apk add --no-cache --virtual .build-deps \
msttcorefonts-installer \
\
# Install microsoft fonts
&& update-ms-fonts \
&& fc-cache -f \
\
# Clean up when done
&& rm -rf /tmp/* \
&& apk del .build-deps
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /usr/bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /usr/bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /usr/bin/
# Installing PHP
RUN apk add --no-cache php8 \
php8-common \
php8-fpm \
php8-pdo \
php8-opcache \
php8-zip \
php8-phar \
php8-iconv \
php8-cli \
php8-curl \
php8-openssl \
php8-mbstring \
php8-tokenizer \
php8-fileinfo \
php8-json \
php8-xml \
php8-xmlwriter \
php8-simplexml \
php8-dom \
php8-pdo_mysql \
php8-pdo_sqlite \
php8-tokenizer \
php8-pecl-redis \
php8-bcmath \
php8-ctype \
php8-gd \
php8-pcntl \
php8-posix \
php8-xmlreader \
php8-intl
# Installing composer
RUN ln -s /usr/bin/php8 /usr/bin/php
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN rm -rf composer-setup.php
# Configure supervisor
RUN mkdir -p /etc/supervisor.d/
# Configure php-fpm
RUN mkdir -p /run/php/
RUN touch /run/php/php8.0-fpm.pid
RUN touch /run/php/php8.0-fpm.sock
RUN sed -i 's~listen = 127.0.0.1:9000~listen = /run/php/php8.0-fpm.sock~g' /etc/php8/php-fpm.d/www.conf
RUN sed -i 's~;listen.owner = nobody~listen.owner = nginx~g' /etc/php8/php-fpm.d/www.conf
RUN sed -i 's~;listen.group = nobody~listen.group = nginx~g' /etc/php8/php-fpm.d/www.conf
RUN sed -i 's~;listen.mode = 0660~listen.mode = 0660~g' /etc/php8/php-fpm.d/www.conf
RUN sed -i 's~user = nobody~user = nginx~g' /etc/php8/php-fpm.d/www.conf
RUN sed -i 's~group = nobody~group = nginx~g' /etc/php8/php-fpm.d/www.conf
# Configure nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN mkdir -p /run/nginx/
RUN touch /run/nginx/nginx.pid
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
# Building process
COPY --chown=nginx:nginx . .
RUN composer install
# Configure Laravel logs
RUN ln -sf /dev/stdout /srv/http/www/invoiceneko/storage/laravel.log
EXPOSE 80
CMD ["supervisord", "-c", "/etc/supervisor.d/supervisord.conf"]