Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-compose.yml for nextcloud development #17420

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions docker/dev/nextcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
A minimal setup to run a Nextcloud inside the TLS-enabled docker development stack.

# First installation steps

1. Allow accessing OP through `openproject.local`:
* `docker compose exec --user www-data nextcloud php occ config:system:set allow_local_remote_servers --value 1`
2. Import Dev CA cert into Nextcloud's own certificate store:
* `docker compose cp /path/to/your/OpenProject_Development_Root_CA.crt nextcloud:/tmp/root.crt`
* `docker compose exec nextcloud chown www-data /tmp/root.crt`
* `docker compose exec --user www-data nextcloud php occ security:certificates:import /tmp/root.crt`
3. Following [docs](https://docs.nextcloud.com/server/30/admin_manual/configuration_server/reverse_proxy_configuration.html#defining-trusted-proxies) configure Traefik as trusted proxy
* e.g. add `'trusted_proxies' => ['172.0.0.0/8'],` to `config/config.php` for a pretty broad allowance for most docker services (verify that your `gateway` network uses IPs in the given address range)
NobodysNightmare marked this conversation as resolved.
Show resolved Hide resolved
4. Download/Activate Nextcloud plugins:
* `integration_openproject`
* `groupfolders` (dependency for certain OP functions)
35 changes: 35 additions & 0 deletions docker/dev/nextcloud/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
nextcloud:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to include the cron override on mine as well

  cron:
    volumes:
      - ${APP_DIR:-./../../custom_apps}:/var/www/html/custom_apps
    networks:
      - external

Copy link
Contributor Author

@NobodysNightmare NobodysNightmare Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post your full cron service definition? I only have the nextcloud service running locally for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Makes sense, if we need cron, we should add it to this compose file. Do you know if cron is needed for our integration purposes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know. Briefly reading does not sound mandatory. But probably useful to have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a cron service as well now. Looking at my local installation, it seems to be working.

image: nextcloud:stable
restart: unless-stopped
networks:
- gateway
volumes:
- nextcloud:/var/www/html
# If you want to use a local version of a plugin, mount a local folder
# more detailed instructions available at https://github.com/nextcloud/integration_openproject/blob/master/docs/setup_via_docker.md
# - ../nextcloud_apps:/var/www/html/custom_apps
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud.rule=Host(`nextcloud.local`)"
- "traefik.http.routers.nextcloud.entrypoints=websecure"
NobodysNightmare marked this conversation as resolved.
Show resolved Hide resolved

cron:
image: nextcloud:stable
restart: unless-stopped
volumes:
- nextcloud:/var/www/html
# If you want to use a local version of a plugin, mount a local folder
# more detailed instructions available at https://github.com/nextcloud/integration_openproject/blob/master/docs/setup_via_docker.md
# - ../nextcloud_apps:/var/www/html/custom_apps
networks:
- gateway
entrypoint: /cron.sh

networks:
gateway:
external: true
name: gateway

volumes:
nextcloud:
Loading