Skip to content

Development Environment for OXID eShop based on docker

Notifications You must be signed in to change notification settings

oxidMichaelWalter/docker-eshop-sdk

 
 

Repository files navigation

Development base

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.

What we have here

For the start:

  • Apache 2.4 (based on original httpd:2.4-alpine container)
  • PHP 7.4 / 8.0 / 8.1 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)
  • Mailhog preconfigured to catch outgoing emails
  • Npm container preconfigured (based on node:latest)
  • Chrome based selenium service available, for running your selenium tests (based on selenium/standalone-chrome-debug)

Requirements

Quick start

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 mailhog
    • run the composer install on php container first.

Adminer is available via http://localhost.local:8080

  • Server: mysql
  • Credentials: root/root

Mailhog is available via http://localhost.local:8025/

Longer start

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

Running php stuff

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

Running npm commands

Direct call

docker-compose run node npm install bootstrap

Connect to node container

make node

Using Sphinx Container for Documentation Generation

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.

Configurations

Apache

Custom configuration file: containers/httpd/project.conf.

PHP

Select PHP version to be used in docker-compose php container configuration. Custom configuration file for php settings: containers/php/custom.ini.

Remote debugging with PHPSTORM

  • Configure the CLI Interpreter
  • Create a Server configuration and set mapping as source:/var/www/

About

Development Environment for OXID eShop based on docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 42.3%
  • PHP 28.4%
  • Dockerfile 24.3%
  • Shell 5.0%