# this is a docker file that allows you to deploy nextcloud
# in a open shift cluster that has a SCC that does not allow you to\
# run the container as user mode.
# pre-runinng:
# you need to find the UID that is assigned to containers in your open shift project.
FROM nextcloud:25
# you need to rus as user root to add users and groups
USER root
# add a new user with a UID that suets the UID that runs inside the open
RUN groupadd --gid 1000710000 nextcloud
RUN useradd -l -u 1000710000 -g 1000710000 -d /var/www -s /usr/sbin/nologin nextcloud
#=============
RUN chown -R nextcloud:nextcloud /var/www/
RUN chown -R nextcloud:nextcloud /usr/local/etc/php/conf.d/
# install plugins:
#RUN sudo -u nextcloud php occ app:install user_social_login
#RUN sudo -u nextcloud php occ app:install richdocumentscode
# configure nextcloud to run with a different port number
RUN sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf
RUN sed -i 's/:80/:8080/g' /etc/apache2/sites-enabled/000-default.conf
USER nextcloud
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]
CMD [ "apache2-foreground" ]