Docker based local environment that can be combined with https://github.com/OXID-eSales/docker-eshop-sdk-recipes for OXID eShop development.
Php and Npm users are synced with the current user so we will have all the rights to modify and access the content generated by using container commands.
For the start:
- Apache 2.4 (based on original httpd:2.4-alpine container)
- Some example SSL certificate added and HTTPS supported for https://localhost.local and https://oxideshop.local domains
- PHP 7.4 / 8.0 / 8.1 / 8.2 fpm (based on oxidesales/oxideshop-docker-php containers which use the official php:x.x-fpm containers as a base) with:
- composer 2
- xDebug 3 with remote debug and profiler preconfigured
- error reporting enabled
- MySQL 5.7 with adminer (original mysql container used)
- Mailpit preconfigured to catch outgoing emails
Additionally, check services directory:
- Npm container preconfigured, so you can easily regenerate grunt/gulp/other builder assets for modules/themes easier (based on node:latest)
- Chrome based selenium service available, for running your selenium tests (based on selenium/standalone-chrome-debug)
- Elasticsearch (also kibana to manage it) containers preconfigured
- NGINX container preconfigured to be used with our NGINX module
- Sphinx container which allows you to regenerate and improve our documentations locally much easier
- Docker (https://docs.docker.com/get-docker/)
- Docker compose (https://docs.docker.com/compose/install/)
127.0.0.1 localhost.local
- in your/etc/hosts
file
git clone https://github.com/OXID-eSales/docker-eshop-sdk.git myProjectName
cd myProjectName
# get some information about whats possible
make help
# setup rights and basic configuration files
make setup
# run example script which prepares several example files for you to see this environment functionality
make example
Access the website through the http://localhost.local
- phpinfo shown on index page
- example with database connection
- example with email sending and catching it with mailpit
- run the composer install on php container first.
Adminer is available via http://localhost.local:8080
- Server: mysql
- Credentials: root/root
Mailpit is available via http://localhost.local:8025/
This example shows more precise configuration which can be used for your project. It is real usage flow:
git clone https://github.com/OXID-eSales/docker-eshop-sdk.git myProjectName
cd myProjectName
# setup rights and basic configuration files
make setup
# add php, mysql and apache services (they are grouped in one command, but can be added separately if needed)
make addbasicservices
# add selenium container to the docker-compose
make file=services/selenium-chrome.yml addservice
# ensure you have source directory available, as its configured as webroot by default
mkdir source
# start everything
make up
# stop everything when its enough :)
make down
We can connect to the php container and do the stuff in there:
make php
php -v
Note: make php
is just an alias for docker-compose exec php bash
We can call commands directly without connecting to the container:
docker-compose run php php -v
docker-compose run node npm install bootstrap
make node
Assuiming you are already inside node container. You should run below command to install project dependencies.
npm install
Assuming that the Grunt has been installed and that the project has already been configured with a package.json then you should follow below steps after entering node container.
- Change to the project's destination directory.
- Install project dependencies with
npm install
- Run Grunt with command
npm run grunt
When running the npm install
command to install your project’s dependencies, the install process may hang. At that time installation hangs without any output.
To resolve such issue run below-mentioned commands.
npm config rm proxy
npm config rm https-proxy
npm config set registry https://registry.npmjs.org/
npm install
To generate documentation from documentation repositories locally, we have a preconfigured Sphinx container that can be utilized.
To get started, ensure you import our Sphinx container service file using the following command: make addsphinxservice
. Here's an example of how to use it:
# Clone shop developer documentation to source directory
git clone https://github.com/OXID-eSales/developer_documentation source/docs
# Add Sphinx container
make docpath=./source/docs addsphinxservice
To regenerate the documentation, simply execute the command make generate-docs
. After doing this, you'll find the generated documentation in the source/docs/build directory
.
Custom configuration file: containers/httpd/project.conf
.
To setup SSL for HTTPS or HTTP/2, checkout the README.md in containers/https/certs
.
Select PHP version to be used in docker-compose php container configuration.
Custom configuration file for php settings: containers/php/custom.ini
.
- Configure the CLI Interpreter
- Create a Server configuration and set mapping as source:/var/www/
The SDK contains basic configuration for a load balancing setup using nginx. Information for creating such a setup can be found in the sdk recipes repository.
Feel free to make improvements for the SDK via Pull requests.
Also, if there are problems with using it, consider creating the Issue in the "Issues" section of this repository on github.