Code Monkey home page Code Monkey logo

piwik-dokku's Introduction

piwik-dokku

This is a Dokku enabled Docker setup for Dokku.

It uses Piwik's official docker image (currently version 3) and extends it with running a slim Nginx server for the php-fpm process.

Setup

Create the app, install the core MariaDB or MySQL plugins and link a new database to the app:

dokku apps:create piwik
dokku mariadb:create piwik
dokku mariadb:link piwik piwik

Storage

Then create a storage directory on the server so that installations of Piwik can be backed-up and installing plugins will persist deployments:

mkdir /var/lib/dokku/data/storage/piwik
chown -R 32767:32767 /var/lib/dokku/data/storage/piwik
dokku storage:mount piwik /var/lib/dokku/data/storage/piwik:/var/www/html

Archiving

Add the following entry to the crontab in `/etc/cron.d/piwik

# server cron jobs
MAILTO="[email protected]"
PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash

# m   h   dom mon dow   username command
# *   *   *   *   *     dokku    command to be executed
# -   -   -   -   -
# |   |   |   |   |
# |   |   |   |   +----- day of week (0 - 6) (Sunday=0)
# |   |   |   +------- month (1 - 12)
# |   |   +--------- day of month (1 - 31)
# |   +----------- hour (0 - 23)
# +----------- min (0 - 59)

### HIGH TRAFFIC TIME IS B/W 00:00 - 04:00 AND 14:00 - 23:59
### RUN YOUR TASKS FROM 04:00 - 14:00
### KEEP SORTED IN TIME ORDER

### PLACE ALL CRON TASKS BELOW

@hourly dokku dokku --rm run piwik su -s "/bin/bash" -c "/usr/local/bin/php /var/www/html/console core:archive" www-data

### PLACE ALL CRON TASKS ABOVE, DO NOT REMOVE THE WHITESPACE AFTER THIS LINE

piwik-dokku's People

Contributors

jezdez avatar

Stargazers

Achilleas Pipinellis avatar Tobias Goecke (Göcke) avatar Nikolaus Schlemm avatar Giorgos Logiotatidis avatar

Watchers

James Cloos avatar  avatar

Forkers

kmattimo hobex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.