docker icon indicating copy to clipboard operation
docker copied to clipboard

PrestaShop in Docker redirects to localhost:8080 instead of configured domain

Open sepiropht opened this issue 1 year ago • 1 comments

Description

I'm experiencing an issue where my PrestaShop setup redirects the domain to localhost:8080 when i use browser instead of the actual domain set for my shop.

Steps to Reproduce

Use ubuntu 22.04

  1. Set up PrestaShop in a Docker container.
  2. Use Caddy as the web server.
  3. Access https://shop.mydomain.com.

Expected Behavior

The shop should open correctly without redirecting to localhost:8080.

Actual Behavior

The shop redirects to localhost:8080, causing a failed page load.

My Caddyfile

shop.mydomain.com {
  reverse_proxy localhost:8080
}

I use the docker compose file from the doc

version: '3'

services:
  mariadb:
    container_name: prestashop-db
    image: mariadb:10.5
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: admin
      MYSQL_DATABASE: prestashop
    volumes:
      - ./mariadb_data:/var/lib/mysql
      - ./my.cnf:/etc/mysql/my.cnf
    networks:
      - prestashop_network
    deploy:
      resources:
        limits:
          memory: 1G

  prestashop:
    container_name: prestashop
    image: prestashop/prestashop:latest
    restart: unless-stopped
    depends_on:
      - mariadb
    ports:
      - "8080:80"
    environment:
      DB_SERVER: prestashop-db
      DB_NAME: prestashop
      DB_USER: root
      DB_PASSWD: admin
      PS_INSTALL_AUTO: 1
      ## there i  also tried my own domain but doesnt' work too but. The doc seems to recommand localhost:8080
      PS_DOMAIN: localhost:8080
    volumes:
      - ./prestashop_data:/var/www/html
    networks:
      - prestashop_network

networks:
  prestashop_network:

sepiropht avatar Aug 30 '24 12:08 sepiropht

were you able to resolve the issue? for me, it results in a redirect loop (v8.2.0)

hatl avatar Feb 05 '25 16:02 hatl