build files for making podman containers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

67 lines
1.9 KiB

### Meta ###
FROM localhost/debian
# Versions of various packages that we may need to refer to
ARG phpv=7.3
ARG psqlv=11
EXPOSE 80/tcp
### Basics ###
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-xml php-json redis-server php-redis postgresql postgresql-doc unzip
RUN mkdir -p /srv/nextcloud/database /srv/nextcloud/files && chown -R www-data:www-data \
/srv/nextcloud
COPY resources/bin/ /usr/local/bin/
### Apache ###
RUN a2enmod rewrite headers env dir mime proxy_fcgi && a2enconf php${phpv}-fpm
COPY resources/site.conf /etc/apache2/sites-available/
WORKDIR /etc/apache2/sites-enabled
RUN rm 000-default.conf && ln -s ../sites-available/site.conf
### PHP ###
RUN systemctl enable php${phpv}-fpm
COPY resources/php.ini /etc/php/${phpv}/fpm/
COPY config/php/www.conf /etc/php/${phpv}/fpm/pool.d/
### Redis ###
COPY --chown=redis:redis resources/redis.conf /etc/redis/
RUN usermod -a -G redis www-data
### PostgreSQL ###
COPY --chown=postgres:postgres resources/pg_hba.conf /etc/postgresql/${psqlv}/main/pg_hba.conf
COPY --chown=postgres:postgres resources/redo.sql /usr/local/lib/psql/
#RUN db-redo
### Nextcloud ###
WORKDIR /var/www/html
RUN wget https://download.nextcloud.com/server/releases/latest.zip && \
unzip latest.zip && \
chown -R www-data:www-data nextcloud && \
rm latest.zip
COPY --chown=www-data:www-data config/nextcloud/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
### Crontab
WORKDIR /root
COPY resources/crontab .
RUN crontab -u www-data crontab && rm crontab