Files
computer-playbook/roles/web-app-nextcloud/templates/Dockerfile.j2
kevinveenbirkenbachandClaude Opus 4.8 f78ec52385 fix(nextcloud): stop the config copy-up race and the root-owned config bind
The custom Dockerfile ran mkdir -p /var/www/html/config, which broke the
stock image's empty-/var/www/html invariant: Docker then had image content
at the shared nextcloud_data mount point and did a non-idempotent copy-up
os.Mkdir(config) per container. compose up --force-recreate starts
nextcloud and cron concurrently, so both raced that mkdir and the loser
crashed with 'failed to mkdir .../_data/config: file exists'. Reproduced
char-for-char locally (31/60 with the infinito bind, 7/80 without, so the
bind is only an aggravator); removing the image content gives 0/80.

Drop the Dockerfile mkdir so /var/www/html stays empty and the stock
entrypoint (reached via nextcloud-init-gate.sh -> /entrypoint.sh) creates
config/ as www-data with no copy-up. The mkdir only existed to pre-seed
config as www-data because binding infinito at /var/www/html/config/infinito
forced Docker to create config/ root:root; move that bind (and its
NEXTCLOUD_DOCKER_CONF_ADD_PATH loader path) out to /var/www/infinito so
config/ is owned by www-data and config.php stays writable. Keeps type:
bind, so the swarm config-object fix from 699008a16 is not reverted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 18:28:10 +02:00

10 lines
394 B
Docker

FROM {{ NEXTCLOUD_IMAGE }}:{{ NEXTCLOUD_VERSION }}
{% if NEXTCLOUD_ONLYOFFICE_ENABLED | bool %}
RUN apk add --no-cache ca-certificates && update-ca-certificates
{% endif %}
COPY {{ NEXTCLOUD_INIT_GATE_FILE }} /usr/local/bin/{{ NEXTCLOUD_INIT_GATE_FILE }}
RUN chmod 0755 /usr/local/bin/{{ NEXTCLOUD_INIT_GATE_FILE }}
ENTRYPOINT ["/usr/local/bin/{{ NEXTCLOUD_INIT_GATE_FILE }}"]
CMD ["php-fpm"]