Vuestorefront can't communicate with Prestashop in DockerFile

Viewed 20

Have a problem with url middleware and prestashop integration. Everything works fine locally, but after moving the frontend (vsf/nuxt) and backends(prestashop) into docker containers the frontend cannot communicate with the prestashop API.

middleware.config.js

module.exports = {
  integrations: {
    prestashop: {
      location: '@vue-storefront/prestashop-api/server',
      configuration: {
        api: {
          url: 'http://lgm-prestashop'
        }
      }
    }
  }
};

docker-compose file:

version: '3.9'

services:
  lgm-front:
    build: .
    container_name: lgm-front
    ports:
      - 3010:3000
    networks:
      - lgm-prestashop
    depends_on:
      - lgm-prestashop
    volumes:
      - ./packages:/var/www/prestashop/packages
    command: yarn dev

  lgm-prestashop:
    image: prestashop/prestashop:1.7
    container_name: lgm-prestashop
    environment:
      - PS_HANDLE_DYNAMIC_DOMAIN=1
      - DB_SERVER=lgm-mysql
      - PS_FOLDER_ADMIN=lagom-admin
      - PS_FOLDER_INSTALL=lagom-install
    ports:
      - 8081:80
    networks:
      - lgm-prestashop

  lgm-mysql:
    image: mysql:8
    container_name: lgm-prestashop-db
    command: --default-authentication-plugin=mysql_native_password
    environment:
      - MYSQL_DATABASE=prestashop
      - MYSQL_ROOT_PASSWORD=prestashop
    # ports:
    #   - 3316:3306
    networks:
      - lgm-prestashop

  lgm-phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - 3011:3000
    environment:
      - PMA_HOST=lgm-mysql
      - VIRTUAL_HOST=phpmyadmin.presta.local
    container_name: lgm-presta_phpmyadmin

networks:
  lgm-prestashop:
0 Answers
Related