-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
88 lines (75 loc) · 2.36 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
FROM php:8.2-fpm
# entrypoint.sh and cron.sh dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
iproute2 \
sudo \
rsync \
bzip2 \
busybox-static \
curl \
smbclient \
; \
rm -rf /var/lib/apt/lists/*; \
\
mkdir -p /var/spool/cron/crontabs; \
echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
# Install phpunit 7
RUN curl -L https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit \
&& chmod +x /usr/local/bin/phpunit
# install the PHP extensions we need
# see https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html
RUN curl -sSLf \
-o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions
RUN install-php-extensions \
apcu \
exif \
gd \
imagick \
intl \
ldap \
memcached \
pcntl \
pdo_mysql \
pdo_pgsql \
redis \
smbclient \
xdebug \
zip
# samba
RUN { \
echo '[global]'; \
echo 'client min protocol = SMB2'; \
echo 'client max protocol = SMB3'; \
echo 'hide dot files = no'; \
} > /etc/samba/smb.conf
# npm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash \
&& export NVM_DIR="/root/.nvm" \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install --lts
# set recommended PHP.ini settings
# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html
RUN echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
\
mkdir /var/www/data; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www
# Add a "docker" user
RUN useradd docker --shell /bin/bash --create-home \
&& usermod --append --groups sudo docker \
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& echo 'docker:secret' | chpasswd
# Cleanup
RUN apt-get clean && apt-get --yes --quiet autoremove --purge \
&& rm -Rf /tmp/*
ADD docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh
USER docker
VOLUME /var/www/nextcloud
WORKDIR /var/www/nextcloud
ENTRYPOINT ["/usr/local/bin/docker_entrypoint.sh"]