Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be21f6f
chore: execute services using profile
vitormattos Aug 12, 2026
c6d93b1
fix: remove container name
vitormattos Aug 12, 2026
cf504a1
chore: remove the uless-stopped to be possible don't start this service
vitormattos Aug 12, 2026
1272a0b
feat: use published hange to define host ports
vitormattos Aug 12, 2026
35fe09b
chore: use command to define the command to be executed when started
vitormattos Aug 12, 2026
bea94fa
feat: use an entrypoint to choose the service that will shutdown
vitormattos Aug 12, 2026
fcd99e1
feat: create the database provider script
vitormattos Aug 12, 2026
cc26632
chore: use master as default Nextcloud server version
vitormattos Aug 12, 2026
6447473
chore: says that the .env is optional
vitormattos Aug 12, 2026
be246e9
chore: improve meaning
vitormattos Aug 12, 2026
e2ec0ab
chore: Remove from service the responsability to says the host port
vitormattos Aug 12, 2026
b8385ca
chore: rename the Nextcloud entrypoint to prevent issues
vitormattos Aug 12, 2026
08456ca
chore: rename database entrypoint
vitormattos Aug 12, 2026
0b687ce
chore: simplify README
vitormattos Aug 12, 2026
79038b9
feat: simplify to customize PHP ini files
vitormattos Aug 12, 2026
f1e752f
chore: update advanced setup with new instructions
vitormattos Aug 12, 2026
db0474c
chore: make possible to have only a database instance
vitormattos Aug 12, 2026
0d356fb
fix: volume paths
vitormattos Aug 12, 2026
7977702
feat: make the ip binding flexible
vitormattos Aug 12, 2026
26896f5
feat: make https port configurable
vitormattos Aug 12, 2026
8d8378f
fix: markdown code block
vitormattos Aug 12, 2026
39463cb
chore: list available databases
vitormattos Aug 12, 2026
7800c75
fix: small changes
vitormattos Aug 12, 2026
9fb7de7
feat: add WARNING to development environment
vitormattos Aug 12, 2026
603277a
feat(php): allow native Xdebug mode selection
vitormattos Aug 12, 2026
3b4d81e
feat(compose): expose native XDEBUG_MODE
vitormattos Aug 12, 2026
b24eaec
docs(advanced): document XDEBUG_MODE
vitormattos Aug 12, 2026
98645ce
ci(compose): validate Compose configurations
vitormattos Aug 12, 2026
9041189
ci: remove redundant Compose validation workflow
vitormattos Aug 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/Dockerfile.php81
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ VOLUME /var/www/html

WORKDIR /var/www/html

ENTRYPOINT [ "bash", "/var/www/scripts/entrypoint.sh" ]
ENTRYPOINT [ "bash", "/var/www/scripts/nextcloud-entrypoint.sh" ]
CMD ["php-fpm"]
2 changes: 1 addition & 1 deletion .docker/Dockerfile.php82
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ VOLUME /var/www/html

WORKDIR /var/www/html

ENTRYPOINT [ "bash", "/var/www/scripts/entrypoint.sh" ]
ENTRYPOINT [ "bash", "/var/www/scripts/nextcloud-entrypoint.sh" ]
CMD ["php-fpm"]
2 changes: 1 addition & 1 deletion .docker/Dockerfile.php83
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ VOLUME /var/www/html

WORKDIR /var/www/html

ENTRYPOINT [ "bash", "/var/www/scripts/entrypoint.sh" ]
ENTRYPOINT [ "bash", "/var/www/scripts/nextcloud-entrypoint.sh" ]
CMD ["php-fpm"]
1 change: 0 additions & 1 deletion .docker/config/php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
xdebug.client_host=host.docker.internal
xdebug.discover_client_host=true
xdebug.log_level=0
xdebug.mode=debug
xdebug.start_with_request=yes
32 changes: 32 additions & 0 deletions .docker/database-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
services:
mysql:
# Pin to 8.4: mysql:latest currently resolves to 9.x, and Nextcloud autoinstall
# runs with the application user, which cannot read mysql.component there.
image: mysql:8.4
volumes:
- ../volumes/mysql/init:/docker-entrypoint-initdb.d
- ../volumes/mysql/data:/var/lib/mysql
ports:
- target: 3306
published: "3306-3325"
host_ip: ${IP_BIND:-127.0.0.1}
command: ["mysqld"]
environment:
- TZ=${TZ:-CET}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-nextcloud}
pgsql:
image: postgres:13-alpine
volumes:
- ../volumes/postgres/data:/var/lib/postgresql/data
ports:
- target: 5432
published: "5432-5451"
host_ip: ${IP_BIND:-127.0.0.1}
command: ["postgres", "-c", "log_statement=all"]
environment:
- POSTGRES_DB=${POSTGRES_DB:-nextcloud}
- POSTGRES_USER=${POSTGRES_USER:-nextcloud}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-nextcloud}
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,5 @@ exec busybox crond -f -l 0 -L /dev/stdout > /dev/null 2>&1 &
runuser -u www-data -- php -f /var/www/html/cron.php

# Start PHP-FPM
if [[ "$HTTP_PORT" != 80 ]]; then
echo "💙 Nextclud is up! Access http://localhost:$HTTP_PORT"
else
echo "💙 Nextclud is up! Access http://localhost"
fi
echo "💙 Nextcloud is up!"
exec "$@"
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Nextcloud development environment

An development apps environment for Nextcloud.
A Docker Compose-based development environment for Nextcloud.

## Development environment
> [!WARNING]
> This environment is intended for development only. It uses default credentials and insecure development settings and must not be used in production.

Run the command:
## Quick start

Start the basic environment with MySQL:

```bash
docker compose up nextcloud mysql nginx mailpit redis
docker compose up
```

* [Advanced setup](docs/advanced-setup.md)
* [Environments](docs/advanced-setup.md#environments)
* [PHP custom settings](docs/advanced-setup.md#php-custom-settings)
* [App development](docs/apps-development.md)
* [Sample](docs/apps-development.md#samble)
* [FAQ](docs/faq.md)
* [Reset setup](docs/faq.md#reset-setup)
* [Upgrade to newest commits of server repository](docs/faq.md#upgrade-to-newest-commits-of-server-repository)
* [Using IDE](docs/faq.md#using-ide)
* [Fix permissions](docs/faq.md#fix-permissions)
* [Simplify commands with alias](docs/bash_aliases.md)
For PostgreSQL, optional services, dynamic host ports, multiple environments,
and other advanced configuration, see the
[advanced setup guide](docs/advanced-setup.md).

## More documentation

- [Advanced setup](docs/advanced-setup.md)
- [App development](docs/apps-development.md)
- [FAQ](docs/faq.md)
77 changes: 40 additions & 37 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
services:
pgsql:
image: postgres:13-alpine
restart: unless-stopped
volumes:
- ./volumes/postgres/data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB:-nextcloud}
- POSTGRES_USER=${POSTGRES_USER:-nextcloud}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-nextcloud}
ports:
- 127.0.0.1:5432:5432
command: postgres -c log_statement=all
mysql:
# Pin to 8.4: mysql:latest currently resolves to 9.x, and Nextcloud autoinstall
# runs with the application user, which cannot read mysql.component there.
image: mysql:8.4
volumes:
- ./volumes/mysql/init:/docker-entrypoint-initdb.d
- ./volumes/mysql/data:/var/lib/mysql
ports:
- 127.0.0.1:3306:3306
restart: unless-stopped
environment:
- TZ=${TZ:-CET}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-nextcloud}
database:
extends:
file: .docker/database-services.yml
service: ${DB_HOST:-mysql}
networks:
default:
aliases:
- ${DB_HOST:-mysql}
nextcloud:
image: ghcr.io/librecodecoop/nextcloud-dev-php${PHP_VERSION:-83}:latest
# build:
# context: .docker/
# dockerfile: Dockerfile.php${PHP_VERSION:-83}
volumes:
- ./.docker/scripts/wait-for-db.php:/var/www/scripts/wait-for-db.php
- ./volumes/php:/var/www/php-config
- ~/.composer:/var/www/.composer/
- ~/.npm:/var/www/.npm/
- ./volumes/nextcloud:/var/www/html
restart: unless-stopped
depends_on:
- database
environment:
- HOST_UID=${HOST_UID:-1000}
- HOST_GID=${HOST_GID:-1000}
Expand All @@ -56,10 +39,11 @@ services:
- MAIL_DOMAIN=${MAIL_DOMAIN:-nextcloud.test}
- MAIL_SMTPPORT=${MAIL_SMTPPORT:-1025}
- MAIL_SMTPHOST=${MAIL_SMTPHOST:-mailpit}
- VERSION_NEXTCLOUD=${VERSION_NEXTCLOUD:-stable33}
- VERSION_NEXTCLOUD=${VERSION_NEXTCLOUD:-master}
- AUTOINSTALL=${AUTOINSTALL:-1}
- XDEBUG_CONFIG
- HTTP_PORT=${HTTP_PORT:-80}
- XDEBUG_MODE
- PHP_INI_SCAN_DIR=/usr/local/etc/php/conf.d:/var/www/php-config
extra_hosts:
- host.docker.internal:host-gateway
nginx:
Expand All @@ -75,23 +59,33 @@ services:
- ./volumes/nginx/includes:/etc/nginx/conf.d/includes/
- ./volumes/nginx/certs:/certs
ports:
- ${HTTP_PORT:-80}:80
- 443:443
- target: 80
published: "${HTTP_PORT:-80-99}"
host_ip: ${IP_BIND:-127.0.0.1}
- target: 443
published: "${HTTPS_PORT:-443-462}"
host_ip: ${IP_BIND:-127.0.0.1}
mailpit:
image: axllent/mailpit
ports:
- 127.0.0.1:${MAILHOG_PORT:-8025}:8025
- target: 8025
published: "${MAILHOG_PORT:-8025-8044}"
host_ip: ${IP_BIND:-127.0.0.1}
redis:
image: redis
eurooffice:
image: ghcr.io/euro-office/documentserver:latest
profiles:
- eurooffice
restart: always
volumes:
- ./volumes/eurooffice:/home/eurooffice/.eurooffice
- ./volumes/eurooffice/local.json:/etc/onlyoffice/documentserver/local.json
- ./volumes/nextcloud/apps-extra/eurooffice-plugin:/var/www/onlyoffice/documentserver/sdkjs-plugins/libresign:ro
ports:
- 8080:80
- target: 80
published: "8080-8099"
host_ip: ${IP_BIND:-127.0.0.1}
environment:
- EXAMPLE_ENABLED=true
- JWT_SECRET=${JWT_SECRET:-my_jwt_secret}
Expand All @@ -101,13 +95,16 @@ services:
- host.docker.internal:host-gateway
playwright:
image: mcr.microsoft.com/playwright:v1.59.1-noble
container_name: nextcloud-playwright
profiles:
- playwright
user: pwuser
volumes:
- ./volumes/nextcloud:/var/www/html
working_dir: /var/www/html
ports:
- 127.0.0.1:9323:9323
- target: 9323
published: "9323-9342"
host_ip: ${IP_BIND:-127.0.0.1}
environment:
- PLAYWRIGHT_BASE_URL=${PLAYWRIGHT_BASE_URL:-https://nginx}
- NODE_ENV=test
Expand All @@ -120,15 +117,21 @@ services:
- default
signal-gateway:
image: bbernhard/signal-cli-rest-api:latest
profiles:
- signal
restart: unless-stopped
ports:
- 127.0.0.1:5001:8080
- target: 8080
published: "5001-5020"
host_ip: ${IP_BIND:-127.0.0.1}
volumes:
- ./volumes/signal:/home/.local/share/signal-cli
environment:
- LOG_LEVEL=info
whatsapp.web:
image: aldinokemal2104/go-whatsapp-web-multidevice
profiles:
- whatsapp
restart: unless-stopped
environment:
- APP_PORT=3000
Expand Down
Loading