forked from sebt3/hubzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
140 lines (129 loc) · 3.21 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
137
138
139
140
FROM alpine:3.20.2 as build
ARG HZ_REPO=https://framagit.org/hubzilla/core
ARG HZ_VERSION=10.0.6
RUN apk add bash \
curl \
gd \
git \
patch \
php82 \
php82-bcmath \
php82-common \
php82-curl \
php82-gd \
php82-iconv \
php82-intl \
php82-mbstring \
php82-mysqli \
php82-openssl \
php82-pecl-imagick \
php82-pecl-mcrypt \
php82-pgsql \
php82-xml \
php82-zip \
&& git clone $HZ_REPO /hubzilla
WORKDIR /hubzilla
COPY entrypoint.sh /hubzilla
RUN chmod +x /hubzilla/entrypoint.sh \
&& git checkout tags/$HZ_VERSION \
&& rm -rf .git \
&& mkdir -p "addon" \
&& mkdir -p "extend" \
&& mkdir -p "log" \
&& mkdir -p "store/[data]/smarty3" \
&& mkdir -p "view/theme" \
&& mkdir -p "widget" \
&& util/add_widget_repo https://framagit.org/hubzilla/widgets.git hubzilla-widgets \
&& util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons \
&& util/add_addon_repo https://framagit.org/dentm42/dm42-hz-addons.git dm42 \
&& util/update_widget_repo hubzilla-widgets \
&& util/update_addon_repo hzaddons \
&& util/update_addon_repo dm42
FROM php:8.2.22-fpm-alpine3.20
RUN apk --update --no-cache --no-progress add \
bash \
git \
icu-libs \
imagemagick \
jpeg \
libavif \
libgcc \
libgd \
libjpeg-turbo \
libmcrypt \
libpng \
libsodium \
libstdc++ \
libwebp \
libzip \
mysql-client \
musl \
oniguruma \
openldap-clients \
postgresql-client \
rsync \
ssmtp \
shadow \
tzdata \
zlib \
&& apk --update --no-progress add --virtual .build-deps \
autoconf \
build-base \
curl-dev \
freetype-dev \
icu-dev \
icu-data-full \
imagemagick-dev \
libavif-dev \
libjpeg-turbo-dev \
libldap \
libmcrypt-dev \
libpng-dev \
libsodium-dev \
libtool \
libwebp-dev \
libxml2-dev \
libzip-dev \
make \
oniguruma-dev \
openldap-dev \
postgresql-dev \
postgresql-libs \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-avif \
### Make sure they're are NO 'configure' commands after this command. Ref: https://github.com/docker-library/php/issues/926 ###
&& docker-php-ext-install \
bcmath \
curl \
gd \
intl \
ldap \
mbstring \
mysqli \
opcache \
pdo \
pdo_mysql \
pdo_pgsql \
pgsql \
sodium \
xml \
zip \
&& docker-php-ext-enable intl.so \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& pecl install -o -f redis \
&& docker-php-ext-enable redis.so \
&& pecl install xhprof \
&& docker-php-ext-enable xhprof.so \
&& echo 'xhprof.output_dir = "/var/www/html/xhprof"'|tee -a /usr/local/etc/php/conf.d/docker-php-ext-xhprof.ini \
&& sed -i '/www-data/s#:[^:]*$#:/bin/bash#' /etc/passwd \
&& echo 'sendmail_path = "/usr/sbin/ssmtp -t"' > /usr/local/etc/php/conf.d/mail.ini \
&& echo -e 'upload_max_filesize = 100M\npost_max_size = 101M' > /usr/local/etc/php/conf.d/hubzilla.ini \
&& echo -e '#!/bin/sh\ncd /var/www/html\n/usr/local/bin/php /var/www/html/Zotlabs/Daemon/Master.php Cron' >/etc/periodic/15min/hubzilla \
&& chmod 755 /etc/periodic/15min/hubzilla \
&& apk --purge del .build-deps \
&& rm -rf /tmp/* /var/cache/apk/*gz
COPY --from=build /hubzilla /var/www/html
ENTRYPOINT [ "/var/www/html/entrypoint.sh" ]
CMD ["php-fpm"]
VOLUME /var/www/html