mirror of
https://github.com/wallabag/docker
synced 2025-12-14 02:06:41 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf82658342 | ||
|
|
abb0647cbd | ||
|
|
6f22d1ef68 | ||
|
|
d1c050662b | ||
|
|
038a5ea6c7 | ||
|
|
c42058bf0f | ||
|
|
3e4cd35253 | ||
|
|
8c15693e12 | ||
|
|
f6e4816eb5 | ||
|
|
bff2dd3d8b | ||
|
|
90265c1653 | ||
|
|
fb020c3be6 | ||
|
|
80a3379a76 | ||
|
|
5203ab63b1 | ||
|
|
65b2e2c7a9 | ||
|
|
4de27027b9 |
76
Dockerfile
76
Dockerfile
@@ -1,61 +1,61 @@
|
|||||||
FROM alpine:edge
|
FROM alpine:edge
|
||||||
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
|
||||||
|
|
||||||
ENV WALLABAG_VERSION=2.1.6 \
|
LABEL maintainer "Marvin Steadfast <marvin@xsteadfastx.org>"
|
||||||
POSTGRES_USER=postgres
|
|
||||||
|
|
||||||
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
ARG WALLABAG_VERSION=2.2.3
|
||||||
&& apk add --update \
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk update \
|
||||||
|
&& apk upgrade --available \
|
||||||
|
&& apk add \
|
||||||
ansible \
|
ansible \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
libwebp@testing \
|
libwebp \
|
||||||
mariadb-client \
|
mariadb-client \
|
||||||
nginx \
|
nginx \
|
||||||
pcre \
|
pcre \
|
||||||
php7 \
|
php7 \
|
||||||
php7-amqp@testing \
|
php7-amqp \
|
||||||
php7-bcmath \
|
php7-bcmath \
|
||||||
php7-ctype@testing \
|
php7-ctype \
|
||||||
php7-curl@testing \
|
php7-curl \
|
||||||
php7-dom@testing \
|
php7-dom \
|
||||||
php7-fpm@testing \
|
php7-fpm \
|
||||||
php7-gd@testing \
|
php7-gd \
|
||||||
php7-gettext@testing \
|
php7-gettext \
|
||||||
php7-iconv@testing \
|
php7-iconv \
|
||||||
php7-json@testing \
|
php7-json \
|
||||||
php7-mbstring@testing \
|
php7-mbstring \
|
||||||
php7-openssl@testing \
|
php7-openssl \
|
||||||
php7-pdo_mysql@testing \
|
php7-pdo_mysql \
|
||||||
php7-pdo_pgsql@testing \
|
php7-pdo_pgsql \
|
||||||
php7-pdo_sqlite@testing \
|
php7-pdo_sqlite \
|
||||||
php7-phar@testing \
|
php7-phar \
|
||||||
php7-session@testing \
|
php7-session \
|
||||||
php7-xml@testing \
|
php7-simplexml \
|
||||||
php7-zlib@testing \
|
php7-tokenizer \
|
||||||
php7@testing\
|
php7-xml \
|
||||||
|
php7-zlib \
|
||||||
py-mysqldb \
|
py-mysqldb \
|
||||||
py-psycopg2 \
|
py-psycopg2 \
|
||||||
py-simplejson \
|
py-simplejson \
|
||||||
|
rabbitmq-c \
|
||||||
s6 \
|
s6 \
|
||||||
tar \
|
tar \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/* \
|
||||||
|
|
||||||
RUN ln -s /usr/bin/php7 /usr/bin/php \
|
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
||||||
|
&& curl -s http://getcomposer.org/installer | php \
|
||||||
RUN curl -s http://getcomposer.org/installer | php \
|
&& mv composer.phar /usr/local/bin/composer \
|
||||||
&& mv composer.phar /usr/local/bin/composer
|
&& git clone --branch $WALLABAG_VERSION --depth 1 https://github.com/wallabag/wallabag.git /var/www/wallabag
|
||||||
|
|
||||||
RUN git clone --branch $WALLABAG_VERSION --depth 1 https://github.com/wallabag/wallabag.git /var/www/wallabag
|
|
||||||
|
|
||||||
COPY root /
|
COPY root /
|
||||||
|
|
||||||
RUN cd /var/www/wallabag \
|
RUN set -ex \
|
||||||
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
&& cd /var/www/wallabag \
|
||||||
|
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist \
|
||||||
RUN chown -R nobody:nobody /var/www/wallabag
|
&& chown -R nobody:nobody /var/www/wallabag
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -72,12 +72,18 @@ $ docker run -p 6379:6379 --name redis redis:alpine
|
|||||||
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
|
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
## DB migration
|
## Upgrading
|
||||||
|
|
||||||
If there is a version upgrade that needs a database migration, you should start the container with the new image and run the migration command.
|
If there is a version upgrade that needs a database migration. The most easy way to do is running the `migrate` command:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker exec -t wallabag /var/www/wallabag/bin/console doctrine:migrations:migrate --env=prod --no-interaction
|
$ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
## docker-compose
|
## docker-compose
|
||||||
@@ -85,7 +91,7 @@ $ docker exec -t wallabag /var/www/wallabag/bin/console doctrine:migrations:migr
|
|||||||
It's 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: '3'
|
||||||
services:
|
services:
|
||||||
wallabag:
|
wallabag:
|
||||||
image: wallabag/wallabag
|
image: wallabag/wallabag
|
||||||
@@ -137,3 +143,11 @@ server {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Import worker
|
||||||
|
|
||||||
|
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:
|
||||||
|
```
|
||||||
|
$ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...> wallabag/wallabag import <type>
|
||||||
|
```
|
||||||
|
Where `<type>` is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox or chrome.
|
||||||
|
|||||||
@@ -1,8 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
provisioner () {
|
||||||
|
echo "Starting provisioner..."
|
||||||
|
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then
|
||||||
|
echo $out;
|
||||||
|
fi
|
||||||
|
echo "Provisioner finished."
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$1" = "wallabag" ];then
|
if [ "$1" = "wallabag" ];then
|
||||||
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
|
provisioner
|
||||||
exec s6-svscan /etc/s6/
|
exec s6-svscan /etc/s6/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "import" ];then
|
||||||
|
provisioner --skip-tags=firstrun
|
||||||
|
cd /var/www/wallabag/
|
||||||
|
exec su -c "bin/console wallabag:import:redis-worker -e=prod $2 -vv" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "migrate" ];then
|
||||||
|
provisioner
|
||||||
|
cd /var/www/wallabag/
|
||||||
|
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
- /var/www/wallabag/data/assets
|
- /var/www/wallabag/data/assets
|
||||||
- /var/www/wallabag/data/db
|
- /var/www/wallabag/data/db
|
||||||
notify: chown dir
|
notify: chown dir
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: write parameters.yml
|
- name: write parameters.yml
|
||||||
template:
|
template:
|
||||||
@@ -68,9 +70,12 @@
|
|||||||
login_port={{ database_port }}
|
login_port={{ database_port }}
|
||||||
login_user=root
|
login_user=root
|
||||||
login_password="{{ database_root_password_mariadb }}"
|
login_password="{{ database_root_password_mariadb }}"
|
||||||
|
encoding="utf8mb4"
|
||||||
notify: run install
|
notify: run install
|
||||||
when: (database_driver == 'pdo_mysql') and
|
when: (database_driver == 'pdo_mysql') and
|
||||||
(populate_database == True)
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: add mariadb user
|
- name: add mariadb user
|
||||||
mysql_user:
|
mysql_user:
|
||||||
@@ -86,6 +91,8 @@
|
|||||||
when: (database_driver == 'pdo_mysql') and
|
when: (database_driver == 'pdo_mysql') and
|
||||||
(database_user != 'root') and
|
(database_user != 'root') and
|
||||||
(populate_database == True)
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: postgresql db
|
- name: postgresql db
|
||||||
postgresql_db:
|
postgresql_db:
|
||||||
@@ -98,6 +105,8 @@
|
|||||||
notify: run install
|
notify: run install
|
||||||
when: (database_driver == 'pdo_pgsql') and
|
when: (database_driver == 'pdo_pgsql') and
|
||||||
(populate_database == True)
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: add postgresql user
|
- name: add postgresql user
|
||||||
postgresql_user:
|
postgresql_user:
|
||||||
@@ -113,6 +122,8 @@
|
|||||||
when: (database_driver == 'pdo_pgsql') and
|
when: (database_driver == 'pdo_pgsql') and
|
||||||
(database_user != 'postgres') and
|
(database_user != 'postgres') and
|
||||||
(populate_database == True)
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: remove cache
|
- name: remove cache
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ parameters:
|
|||||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
database_table_prefix: wallabag_
|
database_table_prefix: wallabag_
|
||||||
database_socket: null
|
database_socket: null
|
||||||
|
database_charset: utf8
|
||||||
|
|
||||||
mailer_transport: smtp
|
mailer_transport: smtp
|
||||||
mailer_host: {{ mailer_host }}
|
mailer_host: {{ mailer_host }}
|
||||||
@@ -36,9 +37,14 @@ parameters:
|
|||||||
rabbitmq_port: 5672
|
rabbitmq_port: 5672
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: guest
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
# Redis processing
|
# Redis processing
|
||||||
redis_scheme: tcp
|
redis_scheme: tcp
|
||||||
redis_host: redis
|
redis_host: redis
|
||||||
redis_port: 6379
|
redis_port: 6379
|
||||||
redis_path: null
|
redis_path: null
|
||||||
|
redis_password: null
|
||||||
|
|
||||||
|
# sites credentials
|
||||||
|
sites_credentials: {}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ parameters:
|
|||||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
database_table_prefix: wallabag_
|
database_table_prefix: wallabag_
|
||||||
database_socket: null
|
database_socket: null
|
||||||
|
database_charset: utf8
|
||||||
|
|
||||||
test_database_driver: pdo_sqlite
|
test_database_driver: pdo_sqlite
|
||||||
test_database_host: 127.0.0.1
|
test_database_host: 127.0.0.1
|
||||||
@@ -44,9 +45,14 @@ parameters:
|
|||||||
rabbitmq_port: 5672
|
rabbitmq_port: 5672
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: guest
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
# Redis processing
|
# Redis processing
|
||||||
redis_scheme: tcp
|
redis_scheme: tcp
|
||||||
redis_host: localhost
|
redis_host: localhost
|
||||||
redis_port: 6379
|
redis_port: 6379
|
||||||
redis_path: null
|
redis_path: null
|
||||||
|
redis_password: null
|
||||||
|
|
||||||
|
# sites credentials
|
||||||
|
sites_credentials: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user