diff --git a/Dockerfile b/Dockerfile index 79e4739..80ec312 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ ENV WALLABAG_VERSION=2.0.7 \ SYMFONY__ENV__DATABASE_NAME=symfony \ SYMFONY__ENV__DATABASE_USER=root \ SYMFONY__ENV__DATABASE_PASSWORD=~ \ + POSTGRES_USER=postgres \ SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv \ SYMFONY__ENV__MAILER_HOST=127.0.0.1 \ SYMFONY__ENV__MAILER_USER=~ \ diff --git a/README.md b/README.md index 2f8155c..e264aa6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Default login is `wallabag:wallabag`. - `-e MYSQL_ROOT_PASSWORD=...` (needed for the mariadb container to initialise and for the entrypoint in the wallabag container to create a database and user if its not there) - `-e POSTGRES_PASSWORD=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there) +- `-e POSTGRES_USER=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there) - `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use) - `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container) - `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host) @@ -52,8 +53,8 @@ $ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSW For using PostgreSQL you have to define some environment variables with the container. Example: ``` -$ docker run docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -d postgres -$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag +$ docker run docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -d postgres +$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag ``` ## docker-compose diff --git a/root/etc/ansible/entrypoint.yml b/root/etc/ansible/entrypoint.yml index 08c306c..1c9ae36 100644 --- a/root/etc/ansible/entrypoint.yml +++ b/root/etc/ansible/entrypoint.yml @@ -10,6 +10,7 @@ database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}" database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}" database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}" + database_root_user_postgres: "{{ lookup('env', 'POSTGRES_USER') }}" database_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}" database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}" @@ -75,7 +76,7 @@ state=present login_host="{{ database_host }}" port={{ database_port }} - login_user=postgres + login_user="{{ database_root_user_postgres }}" login_password="{{ database_root_password_postgres }}" notify: run install when: database_driver == 'pdo_pgsql' @@ -88,7 +89,7 @@ priv=ALL login_host="{{ database_host }}" port={{ database_port }} - login_user=postgres + login_user="{{ database_root_user_postgres }}" login_password="{{ database_root_password_postgres }}" state=present when: (database_driver == 'pdo_pgsql') and