Skip to content

digitalspacestdio/homebrew-docker-compose-akeneo3

 
 

Repository files navigation

Akeneo PIM v3 Docker Compose Environment

The easy environment for Dummies Supported Systems

  • MacOs (Intel, Apple M1)
  • Linux (AMD64, ARM64)
  • Windows via WSL2 (AMD64)

Pre-requirements

Docker

MacOs
Install Docker for Mac: https://docs.docker.com/desktop/mac/install/

Linux
Install Docker Engine: https://docs.docker.com/engine/install/ubuntu/
Install Docker Compose https://docs.docker.com/compose/install/

Windows
Follow this guide: https://docs.docker.com/desktop/windows/wsl/

Homebrew (MacOs/Linux/Windows)

Install Homebrew by following guide https://docs.brew.sh/Installation

Composer Credentials

You need to export COMPOSE_PROJECT_COMPOSER_AUTH variable s othat Composer can use credentials inside containers

export COMPOSE_PROJECT_COMPOSER_AUTH='{
    "http-basic": {
        "repo.example.com": {
            "username": "xxxxxxxxxxxx",
            "password": "yyyyyyyyyyyy"
        }
    },
    "github-oauth": {
        "github.com": "xxxxxxxxxxxx"
    }
}'

Optionally you can add this row to your ~/.bashrc or ~/.zshrc

Installation

Install the formula via homebrew

brew install digitalspacestdio/docker-compose-akeneo3/docker-compose-akeneo3

Option.1 Creating new project from scratch

  1. Create the new projet directory
mkdir ~/akeneo3
  1. Navigate to the projet directory
cd ~/akeneo3
  1. Create the new project
docker-compose-akeneo3 composer create-project akeneo/pim-community-standard /var/www "3.2.*@stable"
  1. Install dependencies
docker-compose-akeneo3 composer install --optimize-autoloader --prefer-dist --no-interaction
docker-compose-akeneo3 yarn install
  1. Install frontend
docker-compose-akeneo3 bin/console cache:clear --no-warmup --env=prod
docker-compose-akeneo3 bin/console pim:installer:assets --symlink --clean --env=prod
  1. Install application
docker-compose-akeneo3 bin/console pim:install --force --symlink --clean --env=prod
docker-compose-akeneo3 yarn run webpack
  1. Start the stack in the background mode
docker-compose-akeneo3 up -d

Application will be available by following link: http://localhost:30380/

Option.2 Starting already exists project from git and local sql dump

  1. Clone the project source code
git clone https://github.com/youcompanyname/akeneo3.git ~/akeneo3
  1. navigate to the project dir
cd  ~/akeneo3
  1. Install dependencies
docker-compose-akeneo3 composer install --optimize-autoloader --prefer-dist --no-interaction
docker-compose-akeneo3 yarn install
  1. Import database dump (supports *.sql and *.sql.gz files)
docker-compose-akeneo3 database-import /path/to/dump.sql.gz
  1. Install frontend
docker-compose-akeneo3 bin/console cache:clear --no-warmup --env=prod
docker-compose-akeneo3 bin/console pim:installer:assets --symlink --clean --env=prod
  1. Install application
docker-compose-akeneo3 yarn run webpack
  1. Start the stack in the background mode
docker-compose-akeneo3 up -d

Application will be available by following link: http://localhost:30380/

Shutdown the project stack

Stop containers

docker-compose-akeneo3 down

Destroy containers and persistent data

docker-compose-akeneo3 down -v

Extra tools

Connecting to the mysql container

docker-compose-akeneo3 mysql

Connecting to the cli container

docker-compose-akeneo3 bash

Generate compose config and run directly without this tool

docker-compose-akeneo3 config > docker-compose.yml
docker compose up

Environment Variables

Can be stored in the .dockenv, .dockerenv or .env file in the project root

  • COMPOSE_PROJECT_MODE - (mutagen|default)
  • COMPOSE_PROJECT_COMPOSER_VERSION - (1|2 )
  • COMPOSE_PROJECT_PHP_VERSION - (7.2), the image will be built from a corresponding fpm-alpine image, see https://hub.docker.com/_/php/?tab=tags&page=1&name=fpm-alpine&ordering=name for more versions
  • COMPOSE_PROJECT_NODE_VERSION - (12.22.8) the image will be built from a corresponding alpine image, see https://hub.docker.com/_/node/tags?page=1&name=alpine3.16 for more versions
  • COMPOSE_PROJECT_MYSQL_IMAGE - biarms/mysql:5.7.33-beta-circleci see https://hub.docker.com/r/biarms/mysql/tags for more versions
  • COMPOSE_PROJECT_ELASTICSEARCH_VERSION - 6.5.4 see https://www.docker.elastic.co/r/elasticsearch/elasticsearch-oss for more versions
  • COMPOSE_PROJECT_NAME - by default the working directory name will be used
  • COMPOSE_PROJECT_PORT_PREFIX - 303 by default
  • COMPOSE_PROJECT_PORT_HTTP - $COMPOSE_PROJECT_PORT_PREFIX + 80 by default
  • COMPOSE_PROJECT_PORT_XHGUI - $COMPOSE_PROJECT_PORT_PREFIX + 81 by default
  • COMPOSE_PROJECT_PORT_MYSQL - $COMPOSE_PROJECT_PORT_PREFIX + 06 by default
  • COMPOSE_PROJECT_PORT_ELASTICSEARCH - $COMPOSE_PROJECT_PORT_PREFIX + 92 by default
  • COMPOSE_PROJECT_PORT_MAIL_WEBGUI - $COMPOSE_PROJECT_PORT_PREFIX + 25 by default

Enable xdebug

In first you need to define the environment variable XDEBUG_MODE

export XDEBUG_MODE=debug

or container specific

export XDEBUG_MODE_FPM=debug
export XDEBUG_MODE_CLI=debug
export XDEBUG_MODE_CRON=debug

Visual Studio Code launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "hostname": "0.0.0.0",
            "port": 9003,
            "pathMappings": {
                "/var/www": "${fileWorkspaceFolder}"
            }
        }
    ]
}

About

The Docker Environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 53.7%
  • Dockerfile 33.1%
  • PHP 9.8%
  • Ruby 2.2%
  • JavaScript 1.2%