akeneo installation

Submitted by Lizhe on Wed, 06/19/2019 - 07:54

akeneo 这里使用的是 docker 方式

使用docker方式的话需要 docker compose 

先从下面地址下载

git clone https://github.com/akeneo/pim-community-standard.git

 里面包含了文件 docker-compose.yml

cd 到 文件所在 的文件夹中

下面内容中的 mysql 被我使用 db 替换掉了,因为我本地的mysql配置不好用,可以直接删除,这里只是为了展示原始内容

version: '3'

 

services:

  fpm:

    image: 'akeneo/fpm:php-7.2'

    user: 'docker'

    volumes:

      - './:/srv/pim'

    working_dir: '/srv/pim'

    networks:

      - 'akeneo'

 

  node:

    image: 'node:10-slim'

    user: 'node'

    volumes:

      - './:/srv/pim'

    working_dir: '/srv/pim'

    networks:

      - 'akeneo'

 

  httpd:

    image: 'httpd:2.4'

    depends_on:

      - 'fpm'

    ports:

      - '${DOCKER_PORT_HTTP}:80'

    volumes:

      - './:/srv/pim:ro'

      - './docker/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro'

      - './docker/akeneo.conf:/usr/local/apache2/conf/vhost.conf:ro'

    networks:

      - 'akeneo'

 

  mysql:

    image: 'mysql:5.7'

    environment:

      MYSQL_ROOT_PASSWORD: 'root'

      MYSQL_USER: 'akeneo_pim'

      MYSQL_PASSWORD: 'akeneo_pim'

      MYSQL_DATABASE: 'akeneo_pim'

    networks:

      - 'akeneo'

 

  elasticsearch:

    image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4'

    environment:

      ES_JAVA_OPTS: "${ES_JAVA_OPTS:--Xms512m -Xmx512m}"

      discovery.type: 'single-node'

    networks:

      - 'akeneo'

  db:

    image: 'mysql:5.7'

    ports:

      - "3307:3306"

    environment:

      MYSQL_DATABASE: lzpac

      MYSQL_ROOT_PASSWORD: lzpac

    networks:

      - 'akeneo'

networks:

  akeneo:

然后就可以直接下载镜像

docker-compose pull

配置访问端口

export DOCKER_PORT_HTTP=80

下一步你需要把 parameters 改个名

cp app/config/parameters.yml.dist app/config/parameters.yml

这个文件的内容要和你的compose文件内容对应

cp app/config/parameters.yml.dist app/config/parameters.yml

 

# This file is auto-generated during the composer install

parameters:

    database_driver: pdo_mysql

    database_host: db

    database_port: 3306

    database_name: lzpac

    database_user: root

    database_password: lzpac

    locale: en

    secret: ThisTokenIsNotSoSecretChangeIt

    product_index_name: akeneo_pim_product

    product_model_index_name: akeneo_pim_product_model

    product_and_product_model_index_name: akeneo_pim_product_and_product_model

    index_hosts: 'elasticsearch:9200'

 

然后启动 

docker-compose up -d

lizhedeMacBook-Pro:pim-community-standard lizhe$ docker ps 

CONTAINER ID        IMAGE                                                     COMMAND                  CREATED             STATUS              PORTS                               NAMES

bb39e062d926        httpd:2.4                                                 "httpd-foreground"       25 minutes ago      Up 25 minutes       0.0.0.0:8080->80/tcp                pim-community-standard_httpd_1

8e83de8bf1c8        mysql:5.7                                                 "docker-entrypoint.s…"   25 minutes ago      Up 25 minutes       3306/tcp, 33060/tcp                 pim-community-standard_mysql_1

b5a2751fed23        akeneo/fpm:php-7.2                                        "/usr/local/bin/entr…"   25 minutes ago      Up 25 minutes                                           pim-community-standard_fpm_1

32171a5756bf        docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4   "/usr/local/bin/dock…"   25 minutes ago      Up 25 minutes       9200/tcp, 9300/tcp                  pim-community-standard_elasticsearch_1

fbe24badb9a7        mysql:5.7                                                 "docker-entrypoint.s…"   25 minutes ago      Up 25 minutes       33060/tcp, 0.0.0.0:3307->3306/tcp   pim-community-standard_db_1

lizhedeMacBook-Pro:pim-community-standard lizhe$ 

 

然后仍然在刚才 cd 的路径内调用

bin/docker/pim-dependencies.sh
bin/docker/pim-initialize.sh

 

docker-compose exec fpm bin/console --env=prod akeneo:batch:job-queue-consumer-daemon &