mirror of
https://github.com/wallabag/docker.git
synced 2025-12-21 19:27:35 +01:00
Merge pull request #14 from mmounirou/feature/allow-db-root-user-config
allow overwrite of the root postgres username
This commit is contained in:
@ -8,6 +8,7 @@ ENV WALLABAG_VERSION=2.0.7 \
|
|||||||
SYMFONY__ENV__DATABASE_NAME=symfony \
|
SYMFONY__ENV__DATABASE_NAME=symfony \
|
||||||
SYMFONY__ENV__DATABASE_USER=root \
|
SYMFONY__ENV__DATABASE_USER=root \
|
||||||
SYMFONY__ENV__DATABASE_PASSWORD=~ \
|
SYMFONY__ENV__DATABASE_PASSWORD=~ \
|
||||||
|
POSTGRES_USER=postgres \
|
||||||
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv \
|
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv \
|
||||||
SYMFONY__ENV__MAILER_HOST=127.0.0.1 \
|
SYMFONY__ENV__MAILER_HOST=127.0.0.1 \
|
||||||
SYMFONY__ENV__MAILER_USER=~ \
|
SYMFONY__ENV__MAILER_USER=~ \
|
||||||
|
|||||||
@ -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 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_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_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_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)
|
- `-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:
|
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 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 "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 --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
|
## docker-compose
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}"
|
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}"
|
||||||
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}"
|
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}"
|
||||||
database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
|
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_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
|
||||||
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
|
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
|
||||||
|
|
||||||
@ -75,7 +76,7 @@
|
|||||||
state=present
|
state=present
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
port={{ database_port }}
|
port={{ database_port }}
|
||||||
login_user=postgres
|
login_user="{{ database_root_user_postgres }}"
|
||||||
login_password="{{ database_root_password_postgres }}"
|
login_password="{{ database_root_password_postgres }}"
|
||||||
notify: run install
|
notify: run install
|
||||||
when: database_driver == 'pdo_pgsql'
|
when: database_driver == 'pdo_pgsql'
|
||||||
@ -88,7 +89,7 @@
|
|||||||
priv=ALL
|
priv=ALL
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
port={{ database_port }}
|
port={{ database_port }}
|
||||||
login_user=postgres
|
login_user="{{ database_root_user_postgres }}"
|
||||||
login_password="{{ database_root_password_postgres }}"
|
login_password="{{ database_root_password_postgres }}"
|
||||||
state=present
|
state=present
|
||||||
when: (database_driver == 'pdo_pgsql') and
|
when: (database_driver == 'pdo_pgsql') and
|
||||||
|
|||||||
Reference in New Issue
Block a user