diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1269488 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +data diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1269488 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data diff --git a/docker-compose.yml b/docker-compose.yml index d7049b2..b1eb937 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: flarum: - build: . + image: git.snyman.info/raoul/flarum:latest environment: MYSQL_DATABASE: flarum MYSQL_USER: flarum @@ -21,10 +21,17 @@ services: - "8000:80" depends_on: - mysql + volumes: + - "./data/extensions:/flarum/app/extensions" + - "./data/assets:/flarum/app/public/assets" + - "./data/storage:/flarum/app/storage" mysql: - image: mysql + image: mariadb:11 environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: flarum MYSQL_USER: flarum MYSQL_PASSWORD: flarum + restart: unless-stopped + volumes: + - "./data/mysql:/var/lib/mysql" diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 190fab9..c04214f 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -2,6 +2,7 @@ set -e # Wait for MySQL/MariaDB +echo "Waiting for MySQL/MariaDB..." MAX_RETRY=45 RETRY=1 while ! mysql --protocol TCP -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" -e "show databases;" > /dev/null 2>&1; do