|
@ -1,7 +1,6 @@ |
|
|
### Meta ### |
|
|
### Meta ### |
|
|
FROM localhost/debian |
|
|
FROM localhost/debian |
|
|
|
|
|
|
|
|
# Versions of various packages that we may need to refer to |
|
|
|
|
|
ARG phpv=7.3 |
|
|
ARG phpv=7.3 |
|
|
ARG psqlv=11 |
|
|
ARG psqlv=11 |
|
|
|
|
|
|
|
@ -10,27 +9,27 @@ EXPOSE 80/tcp |
|
|
### Basics ### |
|
|
### Basics ### |
|
|
RUN apt update -y && apt install -y systemd sudo wget apache2 php-fpm \ |
|
|
RUN apt update -y && apt install -y systemd sudo wget apache2 php-fpm \ |
|
|
php-gd php-zip php-pgsql php-curl php-mbstring php-intl php-imagick \ |
|
|
php-gd php-zip php-pgsql php-curl php-mbstring php-intl php-imagick \ |
|
|
php-xml php-json redis-server php-redis postgresql postgresql-doc unzip |
|
|
php-xml php-json redis-server php-redis postgresql postgresql-doc \ |
|
|
|
|
|
unzip php-ldap |
|
|
|
|
|
|
|
|
RUN mkdir -p /srv/nextcloud/database /srv/nextcloud/files && chown -R www-data:www-data \ |
|
|
RUN mkdir -p /srv/nextcloud/database /srv/nextcloud/files && chown -R www-data:www-data /srv/nextcloud |
|
|
/srv/nextcloud |
|
|
|
|
|
|
|
|
|
|
|
COPY resources/bin/ /usr/local/bin/ |
|
|
COPY resources/bin/ /usr/local/bin/ |
|
|
|
|
|
|
|
|
### Apache ### |
|
|
### Apache ### |
|
|
RUN a2enmod rewrite headers env dir mime proxy_fcgi && a2enconf php${phpv}-fpm |
|
|
RUN a2enmod rewrite headers env dir mime proxy_fcgi && a2enconf php${phpv}-fpm |
|
|
|
|
|
|
|
|
COPY resources/site.conf /etc/apache2/sites-available/ |
|
|
COPY resources/apache/nextcloud.conf /etc/apache2/sites-available/ |
|
|
|
|
|
|
|
|
WORKDIR /etc/apache2/sites-enabled |
|
|
WORKDIR /etc/apache2/sites-enabled |
|
|
|
|
|
|
|
|
RUN rm 000-default.conf && ln -s ../sites-available/site.conf |
|
|
RUN rm 000-default.conf && ln -s ../sites-available/nextcloud.conf |
|
|
|
|
|
|
|
|
### PHP ### |
|
|
### PHP ### |
|
|
RUN systemctl enable php${phpv}-fpm |
|
|
RUN systemctl enable php${phpv}-fpm |
|
|
|
|
|
|
|
|
COPY resources/php.ini /etc/php/${phpv}/fpm/ |
|
|
COPY resources/php/php.ini /etc/php/${phpv}/fpm/ |
|
|
COPY config/php/www.conf /etc/php/${phpv}/fpm/pool.d/ |
|
|
COPY resources/php/www.conf /etc/php/${phpv}/fpm/pool.d/ |
|
|
|
|
|
|
|
|
### Redis ### |
|
|
### Redis ### |
|
|
COPY --chown=redis:redis resources/redis.conf /etc/redis/ |
|
|
COPY --chown=redis:redis resources/redis.conf /etc/redis/ |
|
@ -38,11 +37,9 @@ COPY --chown=redis:redis resources/redis.conf /etc/redis/ |
|
|
RUN usermod -a -G redis www-data |
|
|
RUN usermod -a -G redis www-data |
|
|
|
|
|
|
|
|
### PostgreSQL ### |
|
|
### PostgreSQL ### |
|
|
COPY --chown=postgres:postgres resources/pg_hba.conf /etc/postgresql/${psqlv}/main/pg_hba.conf |
|
|
COPY --chown=postgres:postgres resources/postgresql/pg_hba.conf /etc/postgresql/${psqlv}/main/pg_hba.conf |
|
|
|
|
|
|
|
|
COPY --chown=postgres:postgres resources/redo.sql /usr/local/lib/psql/ |
|
|
COPY --chown=postgres:postgres resources/postgresql/redo.sql /usr/local/lib/psql/ |
|
|
|
|
|
|
|
|
#RUN db-redo |
|
|
|
|
|
|
|
|
|
|
|
### Nextcloud ### |
|
|
### Nextcloud ### |
|
|
WORKDIR /var/www/html |
|
|
WORKDIR /var/www/html |
|
@ -52,11 +49,7 @@ RUN wget https://download.nextcloud.com/server/releases/latest.zip && \ |
|
|
chown -R www-data:www-data nextcloud && \ |
|
|
chown -R www-data:www-data nextcloud && \ |
|
|
rm latest.zip |
|
|
rm latest.zip |
|
|
|
|
|
|
|
|
COPY --chown=www-data:www-data config/nextcloud/my.config.php nextcloud/config/ |
|
|
COPY --chown=www-data:www-data resources/my.config.php nextcloud/config/ |
|
|
|
|
|
|
|
|
#RUN nc-occ maintenance:install --data-dir "/srv/nextcloud/files/" --database "pgsql" --database-host "/var/run/postgresql" --database-name "nextcloud" --database-user "ncadmin" --database-pass "" --admin-user "admin" --admin-pass "admin" |
|
|
|
|
|
|
|
|
|
|
|
#RUN nc-occ maintenance:update:htaccess && nc-occ db:add-missing-indices && nc-occ db:convert-filecache-bigint |
|
|
|
|
|
|
|
|
|
|
|
# TODO: install apps via occ |
|
|
# TODO: install apps via occ |
|
|
|
|
|
|
|
@ -65,3 +58,6 @@ WORKDIR /root |
|
|
COPY resources/crontab . |
|
|
COPY resources/crontab . |
|
|
RUN crontab -u www-data crontab && rm crontab |
|
|
RUN crontab -u www-data crontab && rm crontab |
|
|
|
|
|
|
|
|
|
|
|
### Systemdfile ### |
|
|
|
|
|
COPY Systemdfile /root/ |
|
|
|
|
|
RUN chmod +x /root/Systemdfile |