forked from mriedmann/humhub-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
141 lines (115 loc) · 3.13 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
141
ARG HUMHUB_VERSION=1.6.2
FROM composer:1.10.10 as builder-composer
FROM alpine:3.12.0 as builder
ARG HUMHUB_VERSION
RUN apk update
RUN apk add --no-cache \
ca-certificates \
tzdata \
wget
WORKDIR /usr/src/
RUN wget https://github.com/humhub/humhub/archive/v${HUMHUB_VERSION}.tar.gz -q -O humhub.tar.gz && \
tar xzf humhub.tar.gz && \
mv humhub-${HUMHUB_VERSION} humhub && \
rm humhub.tar.gz
WORKDIR /usr/src/humhub
COPY --from=builder-composer /usr/bin/composer /usr/bin/composer
RUN chmod +x /usr/bin/composer
RUN apk add --no-cache \
php7 \
php7-gd \
php7-ldap \
php7-json \
php7-phar \
php7-iconv \
php7-openssl \
php7-curl \
php7-ctype \
php7-dom \
php7-mbstring \
php7-simplexml \
php7-xml \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
php7-tokenizer \
php7-exif \
php7-fileinfo
RUN composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader && \
chmod +x protected/yii && \
chmod +x protected/yii.bat
RUN apk add --no-cache \
nodejs \
npm
RUN npm install grunt
RUN npm install -g grunt-cli
RUN apk add --no-cache \
php7-pdo_mysql
RUN grunt build-assets
RUN rm -rf ./node_modules
FROM alpine:3.12.0
ARG HUMHUB_VERSION
RUN apk add --no-cache \
curl \
ca-certificates \
imagemagick \
tzdata \
php7 \
php7-fpm \
php7-pdo_mysql \
php7-gd \
php7-ldap \
php7-json \
php7-phar \
php7-iconv \
php7-imagick \
php7-openssl \
php7-curl \
php7-ctype \
php7-dom \
php7-mbstring \
php7-simplexml \
php7-xml \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
php7-sqlite3 \
php7-intl \
php7-apcu \
php7-exif \
php7-fileinfo \
php7-session \
supervisor \
nginx \
sqlite \
&& rm -rf /var/cache/apk/*
RUN BUILD_DEPS="gettext" \
RUNTIME_DEPS="libintl" && \
set -x && \
apk add --no-cache --update $RUNTIME_DEPS && \
apk add --no-cache --virtual build_deps $BUILD_DEPS && \
cp /usr/bin/envsubst /usr/local/bin/envsubst && \
apk del build_deps
ENV PHP_POST_MAX_SIZE=16M
ENV PHP_UPLOAD_MAX_FILESIZE=10M
ENV PHP_MAX_EXECUTION_TIME=60
ENV PHP_MEMORY_LIMIT=1G
ENV PHP_TIMEZONE=UTC
RUN chown -R nginx:nginx /var/lib/nginx/ && \
touch /var/run/supervisor.sock && \
chmod 777 /var/run/supervisor.sock
COPY --from=builder --chown=nginx:nginx /usr/src/humhub /var/www/localhost/htdocs/
COPY --chown=nginx:nginx humhub/ /var/www/localhost/htdocs/
RUN mkdir -p /usr/src/humhub/protected/config/ && \
cp -R /var/www/localhost/htdocs/protected/config/* /usr/src/humhub/protected/config/ && \
echo "v${HUMHUB_VERSION}" > /usr/src/humhub/.version
COPY etc/ /etc/
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod 600 /etc/crontabs/nginx && \
chmod +x /usr/local/bin/docker-entrypoint.sh
VOLUME /var/www/localhost/htdocs/uploads
VOLUME /var/www/localhost/htdocs/protected/config
VOLUME /var/www/localhost/htdocs/protected/modules
EXPOSE 80
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-c", "/etc/supervisord.conf"]