Docker setup for a OXID v6 installation. OXID v6 is currently in beta mode, I wanted to test the OXID installation inside Docker containers. This repository is a work in progress to find a best practice for OXID inside Docker.
Any feedback and pullrequests are welcome! :)
The current setup includes:
- OXID 6
- MySQL 5.7
- PHP 7.0
- PHPMyAdmin
- Install Docker on your system.
- Make sure you clone the repository to your home directory. So we don't clash with macOS permission.
- Run
$ docker-compose up -d
in the root to build and create all Docker containers. - Start the containers with
$ docker-compose start
and use$ docker-compose stop
to stop it. - Install Composer dependencies with
$ docker-compose run composer install
- Add to your local
/etc/hosts
file:127.0.0.1 local.oxid.tld
Go to local.oxid.tld and run through the OXID installer. MySQL Database credentials are:
Host: mysql
User: oxid
Database: oxid
Password: oxid
The credentials can be altered inside the docker-compose.yml
.
After installing and configuring your OXID you can export the MySQL database (without the oxv_*
tables) and store the dump inside docker/assets/database/
. Also add ignored files like config.inc.php
and images to the docker/files/
directory. By doing so you can have minimal working OXID inside your git repository.
- Copy the assets from
docker/assets/files
tosrc/oxid/soruce/
, replacing and merging with existing files. Please make sure hidden (.htaccess
i.e.) are copied as well. - Import the database from
docker/assets/database
, you can find a PHPMyAdmin atlocal.oxid.tld:8080
. Make sure to select the existing (but empty) database namedoxid
- Go to
local.oxid.tld
for Frontend orlocal.oxid.tld/admin/
for Backend
- You can edit the
php.ini
insidedocker/conf/php.ini
, you need to restart the containers with$ docker-compose restart
- All logs of the webserver container are exposed in the automatically created
log/
directory, PHP/Apache logs are insidelog/s/apache2/
Copy the .env.example
file to .env
and change the settings to your values.
Inside PHPStorm https://medium.com/@pablofmorales/xdebug-with-docker-and-phpstorm-786da0d0fad2
.
├── README.md
├── docker
│ ├── assets # files needed to run the project: database dump, config file, images, …
│ │ ├── database
│ │ └── files
│ └── conf # PHP/Apache container settings
│ ├── 000-default.conf
│ ├── Dockerfile
│ ├── modules # PHP modules to be installed with php.ini
│ └── php.ini
├── docker-compose.yml
├── log # contains Apache/PHP Logs of the container (git ignored )
└── src # src contains oxid and other project relevant stugg, i.e. flow-sass
└── oxid
├── composer.json
├── composer.lock
├── source # oxid src
└── vendor
Inside src/
you can locate other project relevant code. For example we use a frontend build porcess with Grunt and create src/pattern
from which we will copy compiled CSS and JavaScript resources into src/oxid/out/<theme>
.
- [ ] What should be excluded in the
.gitignore
? OXID modules installed with composer will be copied tooxid/source/modules/
. Should/can we ignore those? Also Application, themes, etc.? - [ ] Best practice for deployments (Deployer)
- [ ] the Docker setup can be painfully slow on macOS
- [ ] When developing a new extension which includes only stuff for the actual project, should I place inside the modules directory or still install via a new repo and composer?