forked from tine20/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (46 loc) · 2.35 KB
/
Dockerfile
File metadata and controls
61 lines (46 loc) · 2.35 KB
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
FROM richarvey/nginx-php-fpm:latest
WORKDIR /tine
###########################################
RUN mkdir -p /tine/config
RUN mkdir -p /tine/tine20
###############################################################################
# create directory structure for tine20
RUN mkdir cache files logs tmp
RUN chown nginx:nginx cache files logs tmp
# add deps and compile php-redis
RUN apk update
RUN apk add --no-cache --virtual .build-deps autoconf gcc musl-dev make
# compile php-redis
RUN pecl install igbinary
RUN echo -e "extension=igbinary.so\nigbinary.compact_strings=On" > /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini
RUN echo "yes" | pecl install redis
RUN echo "extension=redis.so" > /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
# xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
RUN echo -e "zend_extension=xdebug.so\nxdebug.default_enable=on\nxdebug.remote_enable=on\nxdebug.remote_handler=dbgp\nxdebug.remote_port=9001\nxdebug.remote_host=172.18.0.1\nxdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini
# yaml
RUN apk add yaml-dev
RUN pecl channel-update pecl.php.net
RUN pecl install yaml-2.0.0 && docker-php-ext-enable yaml
# php config: no memory limit
# TODO maybe we should add a limit to php-fpm/nginx config
RUN sed -i 's/memory_limit = 128M//g' /usr/local/etc/php/conf.d/docker-vars.ini
# finalize deps installation
RUN apk del --purge .build-deps
RUN docker-php-source delete
RUN apk del autoconf g++ make
#######
# dev / nodejs / webpack
#######
#RUN cd /tine/tine20/tine20 && composer install --no-interaction --ignore-platform-reqs
#RUN cd /tine/tine20/tine20 && COMPOSER_PROCESS_TIMEOUT=2000 composer install --no-interaction --ignore-platform-reqs
# add nodejs
#RUN apk add nodejs # does not work for the latest image
RUN apk add nodejs-current-npm
# add startup config for webpack
RUN mkdir -p tine20
RUN mkdir -p /etc/supervisor/conf.d/
RUN echo -e "[program:webpack]\ncommand=/usr/bin/npm start\ndirectory=/tine/tine20/Tinebase/js/\nautostart=true\nautorestart=true\npriority=10\nstdout_events_enabled=true\nstderr_events_enabled=true\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0" > /etc/supervisor/conf.d/webpack.conf
# fix php-fpm startup config
RUN sed -i 's#/usr/local/etc/php-fpm.d/www.conf#/usr/local/etc/php-fpm.conf#g' /etc/supervisord.conf