Docker allows you to run the exact same environment on different machines, thus preventing bugs related to using different operating systems (e.g., Windows, macOS, Linux), different packages versions (e.g., Apache HTTP Server, PHP, MySQL...), and therefore different environments (e.g., development, staging, production). Less time dealing with environment issues = more time developing awesome features!
This guide assumes that you are comfortable with developer tools like
git. If you are not, and you are only looking for testing Tiki, you can access our online Tiki demos here: https://tiki.org/Demo If you are a developer but are not comfortable with those tools, you can have a look at the Resources part first.
git clone firstname.lastname@example.org:tikiwiki/tiki-docker.git my-tiki-project cd my-tiki-project
cp .env.example .env
.env file for available config options. By default the latest version of Tiki is installed; you can change the version in the
docker-compose up -d
Wait about 30 seconds for Apache to start and MariaDB to generate the system files. You can go grab a coffee. If you want to check the status live, you can always use the usual
docker-compose logs -f.
docker-compose exec tiki php console.php database:install
Takes about 15 seconds. Lots of queries!
Tiki is now available at http://localhost. Default credentials are the usual
Don't forget to stop the containers once you're done playing:
To start playing again, run the usual:
docker-compose up -d
To modify the source, first follow the same steps as for testing, then:
git clone email@example.com:tikiwiki/tiki.git --origin upstream
Check out the Tiki version you want to work on, e.g.:
git checkout 19.x
Be reminded that the Docker Environment and the Tiki source code are two different things, which is why you need to precise both, the first by editing the
.env file, the later by checking out the branch you need. Docker gives you the correct environment (Apache, PHP, extensions, etc...) while git gives you the correct source code.
If you've installed the source in another folder than the default
tiki, you will need to edit your
.env. Same with port numbers for Apache and MariaDB if you're running several Docker Tiki instances at the same time.
Stop your containers (
docker-compose down ). Then mount the Tiki source by also using the composer dev file when restarting your containers:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
You can now access your Tiki source at http://localhost. It's a normal fresh installation from source, so you will need to install the composer dependencies, the database, etc. See below to access your docker workspace.
docker-compose exec tiki bash
You are now inside your container, in your source code folder. You can do whatever you want, including running
composer install as usual, or Tiki commands like
php console.php database:update.
Xdebug is installed by default in the Docker images. You just need to specify which port your Xdebug client is going to listen to and which host OS is running your Docker Environment in the
.env file. Then set up your client accordingly as you would usually do, and Xdebug will send the debug information to it.
Docker is very fast, but slower on Windows and macOS. If this is an issue for you, the Tiki Docker Environment comes with configuration files for docker-sync, a tool to speed up transfers between your host and your Docker containers. All you have to do is install docker-sync, and start your containers with
docker-sync-stack start rather than
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d. (
docker-sync-stack start will actually launch the latter command after it has started docker-sync.)
Rather than typing every time
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up or
docker-sync-stack start, you might want to create aliases, like for example
devup. Same for stopping your containers:
devdown, or going into your workspace:
- Docker documentation and installation: https://docs.docker.com/
- Git: https://git-scm.com/
- dotenv files: dotenv google search
- Xdebug: https://xdebug.org/
Please report on the tiki-docker repo: https://gitlab.com/tikiwiki/tiki-docker
Related: Kubernetes and AppImage
Everything I know on the topic of getting a working Tiki12 on docker is reported here: https://tiki.org/Tiki-deployement---Experiment-with-appsdeck
See this commit for all the info: https://gitlab.com/synergiq/tiki/commit/050df06191d4652d49faf5f85420890740992862
The link to the branch (from master) is https://gitlab.com/synergiq/tiki/tree/docker