Skip to content

Instantly share code, notes, and snippets.

@dnburgess
Last active November 1, 2023 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save dnburgess/65161ecbfe714b677f37ce8d0e65b2b2 to your computer and use it in GitHub Desktop.
Save dnburgess/65161ecbfe714b677f37ce8d0e65b2b2 to your computer and use it in GitHub Desktop.
DB Tech Matomo Analytics Container
version: '2.1'
services:
matomo:
image: matomo
restart: always
ports:
- 8384:80
environment:
- MATOMO_DATABASE_HOST=db
- MATOMO_DATABASE_TABLES_PREFIX=mat_
- MATOMO_DATABASE_USERNAME=matomo
- MATOMO_DATABASE_PASSWORD=matomo
- MATOMO_DATABASE_DBNAME=matomo
volumes:
- /srv/dev-disk-by-uuid-0d4a201c-b292-412d-ade6-cc5561e54f1f/Configs/Matomo:/var/www/html
links:
- db:db
db:
image: yobasystems/alpine-mariadb:latest
restart: always
environment:
MYSQL_DATABASE: matomo
MYSQL_USER: matomo
MYSQL_PASSWORD: matomo
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- /srv/dev-disk-by-uuid-0d4a201c-b292-412d-ade6-cc5561e54f1f/Configs/Matomodb:/var/lib/mysql
@Yedidyar
Copy link

  db:
    image: yobasystems/alpine-mariadb:latest
    restart: always
    environment:
      - MYSQL_DATABASE: matomo
      - MYSQL_USER: matomo
      - MYSQL_PASSWORD: matomo
      - MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - /srv/dev-disk-by-uuid-0d4a201c-b292-412d-ade6-cc5561e54f1f/Configs/Matomodb:/var/lib/mysql

@dnburgess
Copy link
Author

  db:
    image: yobasystems/alpine-mariadb:latest
    restart: always
    environment:
      - MYSQL_DATABASE: matomo
      - MYSQL_USER: matomo
      - MYSQL_PASSWORD: matomo
      - MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - /srv/dev-disk-by-uuid-0d4a201c-b292-412d-ade6-cc5561e54f1f/Configs/Matomodb:/var/lib/mysql

Is there a question here?

@Yedidyar
Copy link

You forgot to add dash before the environments

@dnburgess
Copy link
Author

Actually, you don't need them if you use ':'. If you use '=' then you need them. I've done it both ways and have never had issues with these techniques.

@Japhys
Copy link

Japhys commented Mar 24, 2023

Hi @dnburgess I tried your compose file but I get this error. Didn't do anything special, just used you example in portainer like I always do. Any ideas? Both used IP with port and domain name via nginx proxy manager. Same results

Could not connect to the database server: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: Temporary failure in name resolution

@Japhys
Copy link

Japhys commented Mar 24, 2023

Hm looks like a problem with alpine-mariadb:latest: latest. if I use alpine-mariadb:10.6.4 it does work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment