FROM nextcloud:25.0.4 WORKDIR /usr/src/nextcloud RUN chown -R www-data:www-data . USER www-data RUN ./occ maintenance:install --admin-pass admin --admin-email admin@example.com RUN ./occ config:system:set allow_local_remote_servers --value=true RUN ./occ config:system:set trusted_domains 1 --value=10.0.2.2 RUN ./occ app:disable password_policy RUN OC_PASS="user1" ./occ user:add --password-from-env --display-name "User One" user1 RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" user2 RUN ./occ app:install news # 21.0.0 RUN ./occ app:install notes # 4.6.0 RUN ./occ app:install uppush # 1.2.0 RUN ./occ app:enable password_policy # TODO: This stopped working randomly with apache not being able to bind to the port during build. Must be some docker changes? #RUN (bash /entrypoint.sh apache2-foreground &) && \ # until curl -s -o /dev/null http://localhost/status.php; do true; done && \ # for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost/ocs/v2.php/cloud/user; done COPY --chown=www-data:www-data overlay /usr/src/nextcloud/