2022-02-11 22:47:49 +08:00
|
|
|
# Docker CLI is a requirement
|
2022-03-31 21:44:32 +08:00
|
|
|
FROM docker:20.10.14-dind-alpine3.15 as dind
|
2022-02-11 22:47:49 +08:00
|
|
|
|
2022-03-14 23:25:47 +08:00
|
|
|
# Caddy is a requirement
|
|
|
|
FROM caddy:2.4.6-alpine as caddy
|
|
|
|
|
2021-12-11 22:41:22 +08:00
|
|
|
# From https://github.com/docker-library/php/blob/master/8.0/bullseye/apache/Dockerfile
|
2022-03-18 20:31:00 +08:00
|
|
|
FROM php:8.0.17-apache-bullseye
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
EXPOSE 80
|
2021-12-03 19:14:39 +08:00
|
|
|
EXPOSE 8080
|
2021-11-30 18:20:42 +08:00
|
|
|
EXPOSE 8443
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
RUN mkdir -p /mnt/docker-aio-config/;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
VOLUME /mnt/docker-aio-config/
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
RUN mkdir -p /var/www/docker-aio;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
WORKDIR /var/www/docker-aio
|
|
|
|
|
|
|
|
RUN apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
git \
|
|
|
|
supervisor \
|
|
|
|
openssl \
|
|
|
|
sudo \
|
2022-01-19 21:22:33 +08:00
|
|
|
dpkg-dev \
|
2021-11-30 18:20:42 +08:00
|
|
|
; \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2022-03-14 23:25:47 +08:00
|
|
|
COPY --from=caddy /usr/bin/caddy /usr/bin/
|
|
|
|
RUN chmod +x /usr/bin/caddy
|
2021-11-30 18:20:42 +08:00
|
|
|
|
2022-02-11 22:47:49 +08:00
|
|
|
COPY --from=dind /usr/local/bin/docker /usr/local/bin/
|
2021-12-08 01:35:18 +08:00
|
|
|
RUN chmod +x /usr/local/bin/docker
|
|
|
|
|
2022-03-14 23:25:47 +08:00
|
|
|
RUN set -ex; \
|
|
|
|
pecl install APCu-5.1.21; \
|
|
|
|
docker-php-ext-enable apcu
|
2022-01-28 21:44:21 +08:00
|
|
|
|
2022-01-10 18:31:44 +08:00
|
|
|
RUN set -e && \
|
|
|
|
curl -sS https://getcomposer.org/installer | php && \
|
|
|
|
mv composer.phar /usr/local/bin/composer && \
|
|
|
|
chmod +x /usr/local/bin/composer && \
|
|
|
|
cd /var/www/docker-aio; \
|
2022-01-28 19:35:40 +08:00
|
|
|
git clone https://github.com/nextcloud-releases/all-in-one.git --depth 1 .; \
|
2022-01-10 18:31:44 +08:00
|
|
|
cd php; \
|
|
|
|
composer install --no-dev; \
|
2022-01-10 19:10:09 +08:00
|
|
|
composer clearcache; \
|
2022-01-10 18:31:44 +08:00
|
|
|
cd ..; \
|
|
|
|
rm -f /usr/local/bin/composer; \
|
2021-12-03 20:13:51 +08:00
|
|
|
chmod 770 -R ./; \
|
2021-12-03 22:32:47 +08:00
|
|
|
chown www-data:www-data -R ./; \
|
|
|
|
rm -r ./php/data; \
|
|
|
|
rm -r ./php/session
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
RUN mkdir -p /etc/apache2/certs && \
|
|
|
|
cd /etc/apache2/certs && \
|
2021-12-03 19:14:39 +08:00
|
|
|
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=DE/ST=BE/L=Local/O=Dev/CN=nextcloud.local" -keyout ./ssl.key -out ./ssl.crt;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
COPY mastercontainer.conf /etc/apache2/sites-available/
|
|
|
|
|
|
|
|
RUN a2enmod rewrite \
|
|
|
|
headers \
|
|
|
|
env \
|
|
|
|
mime \
|
|
|
|
dir \
|
|
|
|
authz_core \
|
|
|
|
proxy \
|
|
|
|
proxy_http \
|
|
|
|
ssl
|
|
|
|
|
|
|
|
RUN rm /etc/apache2/ports.conf; \
|
|
|
|
sed -s -i -e "s/Include ports.conf//" /etc/apache2/apache2.conf; \
|
|
|
|
sed -i "/^Listen /d" /etc/apache2/apache2.conf
|
|
|
|
|
|
|
|
RUN a2dissite 000-default && \
|
|
|
|
a2dissite default-ssl && \
|
2022-01-19 20:42:27 +08:00
|
|
|
a2ensite mastercontainer.conf
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
RUN mkdir /var/log/supervisord; \
|
2021-12-03 19:14:39 +08:00
|
|
|
mkdir /var/run/supervisord;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
COPY Caddyfile /
|
|
|
|
COPY start.sh /usr/bin/
|
|
|
|
COPY cron.sh /
|
|
|
|
COPY supervisord.conf /
|
|
|
|
RUN chmod +x /usr/bin/start.sh; \
|
|
|
|
chmod +x /cron.sh
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
USER root
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
ENTRYPOINT ["start.sh"]
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|