This is a php docker designed to be used with the compose file present in this repository. This is not designed to be a quick dev setup on the fly, but rather a semi-permanent setup. 💻 Built-in: phpunit, ldap, gd, imagick, APCu, redis, memcached...
We basically use the same nginx config than the documentation: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html Only the php-handler server is changed to the php container
- Download this repository and rename it the way you want
- Into the docker folder, clone nextcloud server
git clone git@github.com:nextcloud/server.git
- Into the
server
folder, update the 3rdparty submodule:git submodule update --init
cd server git submodule update --init cd ..
- Execute the stack:
docker-compose up -d
- Access the nextcloud through http://localhost
- Go to the setup of your nextcloud, enter your desired username and your password
- Enjoy contributing! 🥂 🎉
- Search for all the
IF SSL WANTED
strings on thenextcloud.conf
anddocker-compose.yml
- Comment or uncomment accordingly
- Put your ssl certificates on the ssl folder (
fullchain.pem
,privkey.pem
andchain.pem
) - Set your domain name on the
server_name
option of thenextcloud.conf
file - Make sure your browser bind your domain name to the appropriate ip
If you did not change anything on the ports config, you can simply edit your
/etc/hosts
file and add an entry with your domain name and127.0.0.1
: `127.0.0.1 your.domain.name - Add your domain to the list of trusted domains in your
server/config/config.php
file:'trusted_domains' => array ( 0 => 'localhost', 1 => 'your.domain.name', ),
- Now access https://your.domain.name.
$ docker-compose exec web hostname -i
172.20.0.3
- If you want to install apps, you can directly go into your apps management
- but if you want to work on apps development, just clone their git repository into the apps2 folder (on the root, not on the server folder)
We use mariadb by default. If you don't want it, you can:
- Remove the db and phpmyadmin (if present) service form the compose file
- Remove the
MYSQL
environment params of the php service in the compose file - Go to the setup of your nextcloud and choose the desired database
You can run any occ command with docker (example: upgrade)
$ docker-compose exec --user=docker php php occ upgrade
You can run the test you want with phpunit bootstrap
$ docker-compose exec --user=docker php phpunit --bootstrap tests/bootstrap.php tests/Core/Controller/ClientFlowLoginControllerTest.php
Or the full suite:
$ docker-compose exec php phpunit --configuration tests/phpunit-autotest.xml
If you used the default setup with mariadb, you can enable phpmyadmin directly.
- Uncomment the phpmyadmin service in your
docker-compose
file - Run the service:
docker-compose start phpmyadmin
- Retrieve phpmyadmin's IP:
docker-compose exec phpmyadmin hostname -i
(example: 172.20.0.4) - Open your browser and access the ip directly (e.g. http://172.20.0.4/)
- Use your database root user (default user
root
, pass:rootpassword
) The database default name is nextcloud
Want a quick smtp server to test emails on nextcloud ?
- On your compose file, uncomment the smtp service and the smtp volume binding on the php service.
- Edit your
smtp.config.php
file and change the domain by your domain (make sure you've set your email in your nextcloud user account) - Go on the nextcloud smtp settings and click the
Send test email
button! - You've got mail! 📫