README.md 8.38 KB
Newer Older
Marvin Steadfast's avatar
Marvin Steadfast committed
1 2
# What is wallabag?

Marvin Steadfast's avatar
Marvin Steadfast committed
3 4 5 6
[![Build Status](https://travis-ci.org/wallabag/docker.svg?branch=master)](https://travis-ci.org/wallabag/docker)
[![Docker Stars](https://img.shields.io/docker/stars/wallabag/wallabag.svg?maxAge=2592000)](https://hub.docker.com/r/wallabag/wallabag/)
[![Docker Pulls](https://img.shields.io/docker/pulls/wallabag/wallabag.svg?maxAge=2592000)](https://hub.docker.com/r/wallabag/wallabag/)

Marvin Steadfast's avatar
Marvin Steadfast committed
7 8 9 10 11 12 13 14 15 16 17
[wallabag](https://www.wallabag.org/) is a self hostable application for saving web pages. Unlike other services, wallabag is free (as in freedom) and open source.

With this application you will not miss content anymore. Click, save, read it when you want. It saves the content you select so that you can read it when you have time.

# How to use this image

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)
Marvin Steadfast's avatar
Marvin Steadfast committed
18
- `-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)
19
- `-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)
Marvin Steadfast's avatar
Marvin Steadfast committed
20
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
Robin Green's avatar
Robin Green committed
21
- `-e SYMFONY__ENV__DATABASE_DRIVER_CLASS=...` (sets the database driver class to use)
Marvin Steadfast's avatar
Marvin Steadfast committed
22 23 24 25 26
- `-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_NAME=...`(defaults to "symfony", this is the name of the database to use)
- `-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)
27
- `-e SYMFONY__ENV__DATABASE_CHARSET=...` (defaults to utf8, this is the database charset to use)
Marvin Steadfast's avatar
Marvin Steadfast committed
28
- `-e SYMFONY__ENV__SECRET=...` (defaults to "ovmpmAWXRCabNlMgzlzFXDYmCFfzGv")
29
- `-e SYMFONY__ENV__LOCALE=...` (default to en)
Jeremy Benoist's avatar
2.3.4  
Jeremy Benoist committed
30
- `-e SYMFONY__ENV__MAILER_HOST=...`  (defaults to "127.0.0.1", the SMTP host)
31 32 33
- `-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)
Marvin Steadfast's avatar
Marvin Steadfast committed
34
- `-e SYMFONY__ENV__FOSUSER_REGISTRATION=...`(defaults to "true", enable or disable public user registration)
Nicolas Lœuillet's avatar
Nicolas Lœuillet committed
35
- `-e SYMFONY__ENV__FOSUSER_CONFIRMATION=...`(defaults to "true", enable or disable registration confirmation)
36
- `-e SYMFONY__ENV__DOMAIN_NAME=...`  defaults to "https://your-wallabag-url-instance.com", the URL of your wallabag instance)
Kyle Lucy's avatar
Kyle Lucy committed
37 38 39 40 41
- `-e SYMFONY__ENV__REDIS_SCHEME=...` (defaults to "tcp", protocol to use to communicate with the target server (tcp, unix, or http))
- `-e SYMFONY__ENV__REDIS_HOST=...` (defaults to "redis", IP or hostname of the target server)
- `-e SYMFONY__ENV__REDIS_PORT=...` (defaults to "6379", port of the target host)
- `-e SYMFONY__ENV__REDIS_PATH=...`(defaults to "~", path of the unix socket file)
- `-e SYMFONY__ENV__REDIS_PASSWORD=...` (defaults to "~", this is the password defined in the Redis server configuration)
42
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)
Marvin Steadfast's avatar
Marvin Steadfast committed
43

Jeremy Benoist's avatar
Jeremy Benoist committed
44 45 46
## SQLite

The easiest way to start wallabag is to use the SQLite backend. You can spin that up with
Marvin Steadfast's avatar
Marvin Steadfast committed
47 48

```
Marvin Steadfast's avatar
Marvin Steadfast committed
49
$ docker run -p 80:80 wallabag/wallabag
Marvin Steadfast's avatar
Marvin Steadfast committed
50 51
```

52
and point your browser to `http://localhost:80`. For persistent storage you should start the container with a volume:
Marvin Steadfast's avatar
Marvin Steadfast committed
53 54

```
Tom Faulkner's avatar
Tom Faulkner committed
55
$ docker run -v /opt/wallabag/data:/var/www/wallabag/data -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 80:80 wallabag/wallabag
Marvin Steadfast's avatar
Marvin Steadfast committed
56 57
```

Jeremy Benoist's avatar
Jeremy Benoist committed
58
## MariaDB / MySQL
Marvin Steadfast's avatar
Marvin Steadfast committed
59

Jeremy Benoist's avatar
Jeremy Benoist committed
60
For using MariaDB or MySQL you have to define some environment variables with the container. Example:
Marvin Steadfast's avatar
Marvin Steadfast committed
61 62

```
63
$ docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
64
$ 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" -e "SYMFONY__ENV__DATABASE_CHARSET=utf8mb4" -p 80:80 wallabag/wallabag
Marvin Steadfast's avatar
Marvin Steadfast committed
65 66
```

Jeremy Benoist's avatar
Jeremy Benoist committed
67
## PostgreSQL
Marvin Steadfast's avatar
Marvin Steadfast committed
68

Jeremy Benoist's avatar
Jeremy Benoist committed
69
For using PostgreSQL you have to define some environment variables with the container. Example:
Marvin Steadfast's avatar
Marvin Steadfast committed
70 71

```
Nicolas Lœuillet's avatar
Nicolas Lœuillet committed
72
$ docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -d postgres:9.6
Robin Green's avatar
Robin Green committed
73
$ 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_DRIVER_CLASS=Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver' -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
Marvin Steadfast's avatar
Marvin Steadfast committed
74 75
```

76 77
## Redis

Kyle Lucy's avatar
Kyle Lucy committed
78
To use redis with a Docker link, a redis container with the name `redis` is needed and none of the `REDIS` environmental variables are needed:
79 80

 ```
81
$ docker run -p 6379:6379 --name redis redis:alpine
82 83 84
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
```

Kyle Lucy's avatar
Kyle Lucy committed
85 86 87 88 89 90
To use redis with an external redis host, set the appropriate environmental variables. Example:

```
$ docker run -p 80:80 -e "SYMFONY__ENV__REDIS_HOST=my.server.hostname" -e "SYMFONY__ENV__REDIS_PASSWORD=my-secret-pw" wallabag/wallabag
```

91
## Upgrading
92

93
If there is a version upgrade that needs a database migration. The most easy way to do is running the `migrate` command:
94 95

```
96 97 98 99 100 101 102
$ docker run --link wallabag-db:wallabag-db -e <... your config variables here ...>  wallabag/wallabag migrate
```

Or you can start the container with the new image and run the migration command manually:

```
$ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/console doctrine:migrations:migrate --env=prod --no-interaction
103 104
```

Marvin Steadfast's avatar
Marvin Steadfast committed
105 106
## docker-compose

Marvin Steadfast's avatar
Marvin Steadfast committed
107
It's a good way to use [docker-compose](https://docs.docker.com/compose/). Example:
Marvin Steadfast's avatar
Marvin Steadfast committed
108 109

```
110
version: '3'
Marvin Steadfast's avatar
Marvin Steadfast committed
111 112
services:
  wallabag:
Marvin Steadfast's avatar
Marvin Steadfast committed
113
    image: wallabag/wallabag
Marvin Steadfast's avatar
Marvin Steadfast committed
114 115 116 117 118 119 120 121
    environment:
      - MYSQL_ROOT_PASSWORD=wallaroot
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
      - SYMFONY__ENV__DATABASE_HOST=db
      - SYMFONY__ENV__DATABASE_PORT=3306
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      - SYMFONY__ENV__DATABASE_USER=wallabag
      - SYMFONY__ENV__DATABASE_PASSWORD=wallapass
122
      - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
123 124 125 126
      - SYMFONY__ENV__MAILER_HOST=127.0.0.1
      - SYMFONY__ENV__MAILER_USER=~
      - SYMFONY__ENV__MAILER_PASSWORD=~
      - SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
127
      - SYMFONY__ENV__DOMAIN_NAME=your-wallabag-url-instance.com
Marvin Steadfast's avatar
Marvin Steadfast committed
128 129
    ports:
      - "80"
130 131
    volumes:
      - /opt/wallabag/images:/var/www/wallabag/web/assets/images
Marvin Steadfast's avatar
Marvin Steadfast committed
132 133 134 135 136
  db:
    image: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=wallaroot
    volumes:
137
      - /opt/wallabag/data:/var/lib/mysql
138 139
  redis:
    image: redis:alpine
Marvin Steadfast's avatar
Marvin Steadfast committed
140
```
Jeremy Benoist's avatar
Jeremy Benoist committed
141

142
Note that you must fill out the mail related variables according to your mail config.
Marvin Steadfast's avatar
Marvin Steadfast committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165

## nginx

I use nginx to make wallabag public available. This is a example how to use it:

```
server {
        listen 443;
        server_name wallabag.foo.bar;

	ssl on;
        ssl_certificate /etc/letsencrypt/live/wallabag.foo.bar/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/wallabag.foo.bar/privkey.pem;

	location / {
		proxy_pass http://wallabag;
		proxy_set_header X-Forwarded-Host $server_name;
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-For $remote_addr;
	}

}
```
166

Jeremy Benoist's avatar
Jeremy Benoist committed
167
## Import worker
168

Jeremy Benoist's avatar
Jeremy Benoist committed
169
To run the [async redis import worker](http://doc.wallabag.org/en/master/developer/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command:
170 171 172
```
$ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...>  wallabag/wallabag import <type>
```
Jeremy Benoist's avatar
Jeremy Benoist committed
173
Where `<type>` is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox or chrome.