Parcourir la source

[Cloud] workaround database creation

The postgres container creates the database, but the nextcloud installer
wants ton create the DB itself…
So we have to tell to postgres to create a dummy DB.

ref https://github.com/nextcloud/docker/issues/456
Guilhem Saurel il y a 6 ans
Parent
commit
e09152faf1
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 0 1
      cloud/README.md
  2. 4 0
      cloud/docker-compose.yml

+ 0 - 1
cloud/README.md

@@ -5,7 +5,6 @@ https://nextcloud.com/
 ## Configure
 ## Configure
 ```
 ```
 echo POSTGRES_PASSWORD=$(openssl rand -base64 32) >> .env
 echo POSTGRES_PASSWORD=$(openssl rand -base64 32) >> .env
-echo POSTGRES_DB=nextcloud >> .env
 echo POSTGRES_USER=nextcloud >> .env
 echo POSTGRES_USER=nextcloud >> .env
 echo POSTGRES_HOST=db >> .env
 echo POSTGRES_HOST=db >> .env
 ```
 ```

+ 4 - 0
cloud/docker-compose.yml

@@ -8,6 +8,8 @@ services:
   db:
   db:
     image: postgres:10-alpine
     image: postgres:10-alpine
     restart: unless-stopped
     restart: unless-stopped
+    environment:
+      - POSTGRES_DB=workaround  # nextcloud wants to create the db itself
     env_file:
     env_file:
       - .env
       - .env
     volumes:
     volumes:
@@ -16,6 +18,8 @@ services:
   app:
   app:
     image: nextcloud:fpm-alpine
     image: nextcloud:fpm-alpine
     restart: unless-stopped
     restart: unless-stopped
+    environment:
+      - POSTGRES_DB=nextcloud
     env_file:
     env_file:
       - .env
       - .env
     volumes:
     volumes: