mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f6a948f98 | ||
|
|
06af340123 | ||
|
|
4cd689a11c | ||
|
|
6e006e4730 | ||
|
|
d42538d365 | ||
|
|
5ef93a5396 | ||
|
|
7b46fdd314 | ||
|
|
052f98f7ba | ||
|
|
21c4819511 |
@@ -1,7 +1,7 @@
|
|||||||
FROM alpine:edge
|
FROM alpine:edge
|
||||||
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
||||||
|
|
||||||
ENV WALLABAG_VERSION=2.0.1 \
|
ENV WALLABAG_VERSION=2.0.4 \
|
||||||
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite \
|
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite \
|
||||||
SYMFONY__ENV__DATABASE_HOST=127.0.0.1 \
|
SYMFONY__ENV__DATABASE_HOST=127.0.0.1 \
|
||||||
SYMFONY__ENV__DATABASE_PORT=~ \
|
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-mbstring@testing \
|
||||||
php7-openssl@testing \
|
php7-openssl@testing \
|
||||||
php7-pdo_mysql@testing \
|
php7-pdo_mysql@testing \
|
||||||
|
php7-pdo_pgsql@testing \
|
||||||
php7-pdo_sqlite@testing \
|
php7-pdo_sqlite@testing \
|
||||||
php7-phar@testing \
|
php7-phar@testing \
|
||||||
php7-session@testing \
|
php7-session@testing \
|
||||||
php7-xml@testing \
|
php7-xml@testing \
|
||||||
php7@testing\
|
php7@testing\
|
||||||
py-mysqldb \
|
py-mysqldb \
|
||||||
|
py-psycopg2 \
|
||||||
py-simplejson \
|
py-simplejson \
|
||||||
s6 \
|
s6 \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -11,6 +11,7 @@ Default login is `wallabag:wallabag`.
|
|||||||
## Environment variables
|
## 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 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_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)
|
||||||
@@ -39,19 +40,27 @@ 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 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
|
## docker-compose
|
||||||
|
|
||||||
Its a good way to use [docker-compose](https://docs.docker.com/compose/). Example:
|
It's a good way to use [docker-compose](https://docs.docker.com/compose/). Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
wallabag:
|
wallabag:
|
||||||
build:
|
image: wallabag/wallabag
|
||||||
context: wallabag/
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME') }}"
|
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME') }}"
|
||||||
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: "{{ 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') }}"
|
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
- name: notify install for sqlite
|
- name: notify install for sqlite
|
||||||
debug:
|
debug:
|
||||||
msg='notify installation script if sqlite db does not exist'
|
msg='notify installation script if sqlite db does not exist'
|
||||||
|
changed_when: true
|
||||||
notify: run install
|
notify: run install
|
||||||
when: (database_driver == 'pdo_sqlite') and
|
when: (database_driver == 'pdo_sqlite') and
|
||||||
(wallabag_sqlite_db.stat.exists == False)
|
(wallabag_sqlite_db.stat.exists == False)
|
||||||
@@ -38,16 +40,18 @@
|
|||||||
- name: wait for db container
|
- name: wait for db container
|
||||||
wait_for:
|
wait_for:
|
||||||
host="{{ database_host }}"
|
host="{{ database_host }}"
|
||||||
port=3306
|
port="{{ database_port }}"
|
||||||
when: database_driver == 'pdo_mysql'
|
when: (database_driver == 'pdo_mysql') or
|
||||||
|
(database_driver == 'pdo_pgsql')
|
||||||
|
|
||||||
- name: mariadb db
|
- name: add mariadb db
|
||||||
mysql_db:
|
mysql_db:
|
||||||
name="{{ database_name }}"
|
name="{{ database_name }}"
|
||||||
state=present
|
state=present
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
|
login_port={{ database_port }}
|
||||||
login_user=root
|
login_user=root
|
||||||
login_password="{{ database_root_password }}"
|
login_password="{{ database_root_password_mariadb }}"
|
||||||
notify: run install
|
notify: run install
|
||||||
when: database_driver == 'pdo_mysql'
|
when: database_driver == 'pdo_mysql'
|
||||||
|
|
||||||
@@ -58,13 +62,38 @@
|
|||||||
password="{{ database_password }}"
|
password="{{ database_password }}"
|
||||||
priv={{ database_name }}.*:ALL
|
priv={{ database_name }}.*:ALL
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
login_port="{{ database_port }}"
|
login_port={{ database_port }}
|
||||||
login_user=root
|
login_user=root
|
||||||
login_password="{{ database_root_password }}"
|
login_password="{{ database_root_password_mariadb }}"
|
||||||
state=present
|
state=present
|
||||||
when: (database_driver == 'pdo_mysql') and
|
when: (database_driver == 'pdo_mysql') and
|
||||||
(database_user != 'root')
|
(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
|
- name: remove cache
|
||||||
file:
|
file:
|
||||||
path=/var/www/wallabag/var/cache
|
path=/var/www/wallabag/var/cache
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ http {
|
|||||||
internal;
|
internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
access_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user