diff --git a/README.md b/README.md index 93c6227..d6ce258 100644 --- a/README.md +++ b/README.md @@ -53,27 +53,9 @@ docker run -d \ m1k1o/blog:latest ``` -Or in docker-compose format: -```yml -version: "3" -services: - blog: - image: m1k1o/blog:latest - restart: unless-stopped - environment: - TZ: Europe/Vienna - BLOG_TITLE: Blog - BLOG_NAME: Max Musermann - BLOG_NICK: username - BLOG_PASS: password - BLOG_LANG: en - ports: - - 80:80 - volumes: - - ./data:/var/www/html/data -``` +Or for docker-compose format, see [docker-compose.yml](docker-compose.yml). -## Install standalone app using `docker-compose` +## Install standalone app using `docker-compose` with external database You need to install [docker-compose](https://docs.docker.com/compose/install/). ### MySQL @@ -148,6 +130,7 @@ volumes: ``` ### Step 1: Run `docker-compose.yml`. +Select one of configurations above and save it to `docker-compose.yml`. Then run: ```sh docker-compose up -d ``` diff --git a/docker-compose.yml b/docker-compose.yml index fa49147..5815908 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,33 +1,17 @@ version: "3" services: - webserver: + blog: image: m1k1o/blog:latest - container_name: blog_apache - environment: - TZ: Europe/Vienna - BLOG_DB_CONNECTION: mysql - BLOG_MYSQL_HOST: mariadb - BLOG_MYSQL_PORT: 3306 - BLOG_MYSQL_USER: blog - BLOG_MYSQL_PASS: blog # use secure password - BLOG_DB_NAME: blog restart: unless-stopped + environment: + TZ: Europe/Vienna + BLOG_TITLE: Blog + BLOG_NAME: Max Musermann + BLOG_NICK: username + BLOG_PASS: password + BLOG_LANG: en ports: - - ${HTTP_PORT-80}:80 - volumes: - - ${DATA-./data}:/var/www/html/data - mariadb: - image: mariadb:10.1 - container_name: blog_mariadb - environment: - MYSQL_USER: blog - MYSQL_PASSWORD: blog # use secure password - MYSQL_DATABASE: blog - MYSQL_ROOT_PASSWORD: root # use secure password - restart: unless-stopped + - 80:80 volumes: - - mariadb:/var/lib/mysql - - ./app/db/mysql:/docker-entrypoint-initdb.d:ro -volumes: - mariadb: + - ./data:/var/www/html/data