1
0
mirror of https://github.com/wallabag/docker synced 2025-12-13 17:56:31 +00:00

5 Commits
2.0.2 ... 2.0.3

Author SHA1 Message Date
Marvin Steadfast
06af340123 Added Postgres support
Now its possible to use a Postgres container as database backend.
2016-04-25 12:33:57 +02:00
Jeremy Benoist
4cd689a11c Merge pull request #5 from iMelnik/patch-1
Fix logs naming
2016-04-24 21:14:46 +02:00
Sergey Melnik
6e006e4730 Fix logs naming
Errors to error.log and access to access.log
2016-04-24 22:13:25 +03:00
xsteadfastx
d42538d365 Merge pull request #4 from wallabag/docker-wllbg-203
Prepare 2.0.3
2016-04-22 18:32:31 +02:00
Nicolas Lœuillet
5ef93a5396 Prepare 2.0.3 2016-04-22 18:17:23 +02:00
4 changed files with 52 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
FROM alpine:edge
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
ENV WALLABAG_VERSION=2.0.2 \
ENV WALLABAG_VERSION=2.0.3 \
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite \
SYMFONY__ENV__DATABASE_HOST=127.0.0.1 \
SYMFONY__ENV__DATABASE_PORT=~ \
@@ -31,12 +31,14 @@ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/
php7-mbstring@testing \
php7-openssl@testing \
php7-pdo_mysql@testing \
php7-pdo_pgsql@testing \
php7-pdo_sqlite@testing \
php7-phar@testing \
php7-session@testing \
php7-xml@testing \
php7@testing\
py-mysqldb \
py-psycopg2 \
py-simplejson \
s6 \
&& rm -rf /var/cache/apk/*

View File

@@ -11,6 +11,7 @@ Default login is `wallabag:wallabag`.
## Environment variables
- `-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 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)
@@ -39,7 +40,16 @@ For using mariadb or mysql you have to define some environment variables with th
```
$ docker run docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 xsteadfastx/wallabag
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
```
## postgresql
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-compose
@@ -50,8 +60,7 @@ It's a good way to use [docker-compose](https://docs.docker.com/compose/). Examp
version: '2'
services:
wallabag:
build:
context: wallabag/
image: wallabag/wallabag
environment:
- MYSQL_ROOT_PASSWORD=wallaroot
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql

View File

@@ -9,7 +9,8 @@
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME') }}"
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}"
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}"
database_root_password: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
database_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
tasks:
@@ -39,16 +40,18 @@
- name: wait for db container
wait_for:
host="{{ database_host }}"
port=3306
when: database_driver == 'pdo_mysql'
port="{{ database_port }}"
when: (database_driver == 'pdo_mysql') or
(database_driver == 'pdo_pgsql')
- name: mariadb db
- name: add mariadb db
mysql_db:
name="{{ database_name }}"
state=present
login_host="{{ database_host }}"
login_port={{ database_port }}
login_user=root
login_password="{{ database_root_password }}"
login_password="{{ database_root_password_mariadb }}"
notify: run install
when: database_driver == 'pdo_mysql'
@@ -59,13 +62,38 @@
password="{{ database_password }}"
priv={{ database_name }}.*:ALL
login_host="{{ database_host }}"
login_port="{{ database_port }}"
login_port={{ database_port }}
login_user=root
login_password="{{ database_root_password }}"
login_password="{{ database_root_password_mariadb }}"
state=present
when: (database_driver == 'pdo_mysql') and
(database_user != 'root')
- name: postgresql db
postgresql_db:
name="{{ database_name }}"
state=present
login_host="{{ database_host }}"
port={{ database_port }}
login_user=postgres
login_password="{{ database_root_password_postgres }}"
notify: run install
when: database_driver == 'pdo_pgsql'
- name: add postgresql user
postgresql_user:
name="{{ database_user }}"
password="{{ database_password }}"
db={{ database_name }}
priv=ALL
login_host="{{ database_host }}"
port={{ database_port }}
login_user=postgres
login_password="{{ database_root_password_postgres }}"
state=present
when: (database_driver == 'pdo_pgsql') and
(database_user != 'postgres')
- name: remove cache
file:
path=/var/www/wallabag/var/cache

View File

@@ -57,8 +57,8 @@ http {
internal;
}
error_log /var/log/nginx/access.log;
access_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
}