Add Docker configuration for Postgres and MariaDB

This commit is contained in:
Fabien MEURILLON 2016-01-09 17:27:21 +01:00
parent 540ef5e084
commit 1d41effebc
6 changed files with 62 additions and 1 deletions

3
.gitignore vendored
View file

@ -37,5 +37,6 @@
data/assets/*
data/db/wallabag*.sqlite
# Docker container logs
# Docker container logs and data
docker/logs/
docker/data/

View file

@ -1,5 +1,15 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
# Uncomment these settings or manually update your parameters.yml
# to use docker-compose
#
# database_driver: %env.database_driver%
# database_host: %env.database_host%
# database_port: %env.database_port%
# database_name: %env.database_name%
# database_user: %env.database_user%
# database_password: %env.database_password%
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~

View file

@ -15,3 +15,28 @@ php:
- "9000:9000"
volumes:
- .:/var/www/html
#links:
# - "postgres:rdbms"
# - "mariadb:rdbms"
env_file:
- ./docker/php/env
# Comment non-used DBMS lines
# If all DBMS are commented out, sqlite will be used as default
# - ./docker/postgres/env
# - ./docker/mariadb/env
#postgres:
# image: postgres:9
# ports:
# - "5432:5432"
# volumes:
# - ./docker/data/pgsql:/var/lib/postgresql/data
# env_file:
# - ./docker/postgres/env
#mariadb:
# image: mariadb:10
# ports:
# - "3306:3306"
# volumes:
# - ./docker/data/mariadb:/var/lib/mysql
# env_file:
# - ./docker/mariadb/env

10
docker/mariadb/env Normal file
View file

@ -0,0 +1,10 @@
MYSQL_ROOT_PASSWORD=wallaroot
MYSQL_USER=wallabag
MYSQL_PASSWORD=wallapass
MYSQL_DATABASE=wallabag
SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
SYMFONY__ENV__DATABASE_HOST=rdbms
SYMFONY__ENV__DATABASE_PORT=3306
SYMFONY__ENV__DATABASE_NAME=wallabag
SYMFONY__ENV__DATABASE_USER=wallabag
SYMFONY__ENV__DATABASE_PASSWORD=wallapass

6
docker/php/env Normal file
View file

@ -0,0 +1,6 @@
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite
SYMFONY__ENV__DATABASE_HOST=127.0.0.1
SYMFONY__ENV__DATABASE_PORT=~
SYMFONY__ENV__DATABASE_NAME=symfony
SYMFONY__ENV__DATABASE_USER=root
SYMFONY__ENV__DATABASE_PASSWORD=~

9
docker/postgres/env Normal file
View file

@ -0,0 +1,9 @@
POSTGRES_USER=wallabag
POSTGRES_PASSWORD=wallapass
POSTGRES_DB=wallabag
export SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
export SYMFONY__ENV__DATABASE_HOST=rdbms
export SYMFONY__ENV__DATABASE_PORT=5432
export SYMFONY__ENV__DATABASE_NAME=wallabag
export SYMFONY__ENV__DATABASE_USER=wallabag
export SYMFONY__ENV__DATABASE_PASSWORD=wallapass