mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b165d3c14f | ||
|
|
8ce69e0d48 | ||
|
|
3c96d9d6d9 | ||
|
|
fdffa0f9ec | ||
|
|
6a67881572 | ||
|
|
038bef09cd | ||
|
|
26b75eee75 | ||
|
|
025c51422e | ||
|
|
5f6a948f98 | ||
|
|
06af340123 | ||
|
|
4cd689a11c | ||
|
|
6e006e4730 | ||
|
|
d42538d365 | ||
|
|
5ef93a5396 |
11
Dockerfile
11
Dockerfile
@@ -1,14 +1,19 @@
|
||||
FROM alpine:edge
|
||||
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
||||
|
||||
ENV WALLABAG_VERSION=2.0.2 \
|
||||
ENV WALLABAG_VERSION=2.0.7 \
|
||||
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=~ \
|
||||
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv
|
||||
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv \
|
||||
SYMFONY__ENV__MAILER_HOST=127.0.0.1 \
|
||||
SYMFONY__ENV__MAILER_USER=~ \
|
||||
SYMFONY__ENV__MAILER_PASSWORD=~ \
|
||||
SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
|
||||
|
||||
|
||||
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||
&& apk add --update \
|
||||
@@ -31,12 +36,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/*
|
||||
|
||||
25
README.md
25
README.md
@@ -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)
|
||||
@@ -18,7 +19,10 @@ Default login is `wallabag:wallabag`.
|
||||
- `-e SYMFONY__ENV__DATABASE_USER=...` (defaults to "root", this is the name of the database user to use)
|
||||
- `-e SYMFONY__ENV__DATABASE_PASSWORD=...` (defaults to "~", this is the password of the database user to use)
|
||||
- `-e SYMFONY__ENV__SECRET=...` (defaults to "ovmpmAWXRCabNlMgzlzFXDYmCFfzGv")
|
||||
|
||||
- `-e SYMFONY__ENV__MAILER_HOST=...` defaults to "127.0.0.1", the SMTP host)
|
||||
- `-e SYMFONY__ENV__MAILER_USER=...` (defaults to "~", the SMTP user)
|
||||
- `-e SYMFONY__ENV__MAILER_PASSWORD=...`(defaults to "~", the SMTP password)
|
||||
- `-e SYMFONY__ENV__FROM_EMAIL=...`(defaults to "wallabag@example.com", the address wallabag uses for outgoing emails)
|
||||
## sqlite
|
||||
|
||||
The easiest way to start wallabag is to use the sqlite backend. You can spin that up with
|
||||
@@ -39,7 +43,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 +63,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
|
||||
@@ -60,6 +72,10 @@ services:
|
||||
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||
- SYMFONY__ENV__MAILER_HOST=127.0.0.1
|
||||
- SYMFONY__ENV__MAILER_USER=~
|
||||
- SYMFONY__ENV__MAILER_PASSWORD=~
|
||||
- SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
|
||||
ports:
|
||||
- "80"
|
||||
db:
|
||||
@@ -69,6 +85,7 @@ services:
|
||||
volumes:
|
||||
- /opt/wallabag:/var/lib/mysql
|
||||
```
|
||||
Note that you must fill out the mail related variables according to your mail config.
|
||||
|
||||
## nginx
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,6 +23,7 @@ http {
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
open_file_cache max=100;
|
||||
client_max_body_size 50M;
|
||||
|
||||
|
||||
upstream php-upstream {
|
||||
@@ -57,8 +58,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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ parameters:
|
||||
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
||||
|
||||
mailer_transport: smtp
|
||||
mailer_host: 127.0.0.1
|
||||
mailer_user: ~
|
||||
mailer_password: ~
|
||||
mailer_host: %env.mailer_host%
|
||||
mailer_user: %env.mailer_user%
|
||||
mailer_password: %env.mailer_password%
|
||||
|
||||
locale: en
|
||||
|
||||
@@ -28,9 +28,9 @@ parameters:
|
||||
|
||||
# two factor stuff
|
||||
twofactor_auth: true
|
||||
twofactor_sender: no-reply@wallabag.org
|
||||
twofactor_sender: %env.from_email%
|
||||
|
||||
# fosuser stuff
|
||||
fosuser_confirmation: true
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
from_email: %env.from_email%
|
||||
|
||||
Reference in New Issue
Block a user