docker
docker copied to clipboard
Warning about default_phone_region
Hi, I just create a Docker instance for Nextcloud and I get a warning about default_phone_region. I'm French and I must edit the data/config/config.php file to add : 'force_language' => 'fr', 'default_locale' => 'fr_FR', 'force_locale' => 'fr_FR', 'default_language' => 'fr', 'default_phone_region' => 'FR', Is it possible to configure it without editing config.php ? Could you add an environment variable to configure it ? Thank you !
Duplicate of #1465
Not exacly a variable, but i managed to do some tricks in entrypoint section.
Now i have All checks passed just after launching nextcloud.
Here it's nexcloud with traefik, but entryoint is not related to traefik at all.
nextcloud-app:
image: nextcloud:latest
entrypoint: sh -c "apt update && apt upgrade -y && apt install --no-install-recommends -y libmagickcore-6.q16-6-extra && runuser -u www-data -- php occ config:system:set default_phone_region --type string --value="PL" && echo "expose_php=Off" >> /usr/local/etc/php/conf.d/nextcloud.ini && /entrypoint.sh apache2-foreground"
container_name: nextcloud-app
restart: always
depends_on:
- nextcloud-db
- nextcloud-redis
environment:
- REDIS_HOST=nextcloud-redis
- REDIS_HOST_PASSWORD=test # REPLACE WITH REDIS PASSWORD
- MYSQL_HOST=nextcloud-db
- MYSQL_USER=nextcloud # MYSQL USERNAME
- MYSQL_PASSWORD=test # PASSWORD OF MYSQL USER
- MYSQL_DATABASE=nextcloud # MYSQL DATABASE
- NEXTCLOUD_TRUSTED_DOMAINS=cloud.domain.com
- OVERWRITEHOST=cloud.domain.com
- OVERWRITEPROTOCOL=https
- OVERWRITECLIURL=https://cloud.ndomian.com
- TRUSTED_PROXIES=172.22.0.0/24
- APACHE_DISABLE_REWRITE_IP=1
volumes:
- ./nextcloud:/var/www/html
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.middlewares.nextcloud-https.redirectscheme.scheme=https"
- "traefik.http.routers.nextcloud-http.entrypoints=http"
- "traefik.http.routers.nextcloud-http.rule=Host(`cloud.domain.com`)"
- "traefik.http.routers.nextcloud-http.middlewares=nextcloud-https@docker"
- "traefik.http.routers.nextcloud.entrypoints=https"
- "traefik.http.routers.nextcloud.rule=Host(`cloud.domain.com`)"
- "traefik.http.routers.nextcloud.tls=true"
- "traefik.http.routers.nextcloud.middlewares=nextcloud-dav,secHeaders@file"
- "traefik.http.services.nextcloud.loadbalancer.server.port=80"
- "traefik.http.middlewares.nextcloud-dav.replacepathregex.regex=^/.well-known/ca(l|rd)dav"
- "traefik.http.middlewares.nextcloud-dav.replacepathregex.replacement=/remote.php/dav/"
networks:
- proxy
- default
runuser -u www-data -- php occ config:system:set default_phone_region --type string --value="PL" is essentially what You need to set that up.
This issue can be close, you can configure all variables like this :
NC_force_language: fr
NC_default_locale: fr_FR
NC_force_locale: fr_FR
NC_default_language: fr
NC_default_phone_region: fr
You can see the discussion, the MR and code.
Duplicate of #1465
Are we sure this works? I'm putting this in my docker compose file and it's not setting these in my config.php...
version: '3'
services:
nextcloud:
container_name: nextcloud
image: nextcloud:26.0.2-apache
restart: unless-stopped
environment:
- NC_force_language="fr"
- NC_default_locale="fr_FR"
- NC_force_locale="fr_FR"
- NC_default_language="fr"
- NC_default_phone_region="fr"
...
...
...
Environment variables are not written into config.php. These are runtime settings that overwrite config.php.
@J0WI wow that makes sense why I'm not seeing it. Thanks for the reply!