Jump to content

Anyone intalled ps behind a traefik reverse proxy?


Recommended Posts

I've got no issue running ps in a container (without traefik) but as soon as i add traefik labels to the compose file i get 404 or bad gateway.
I'm sure there's something that i need to change in the compose file, but im not sure what? Can you help?

Like i say, i can run traefik with other containers (all with wildcard tls certs working fine) but when i add ps - it doesnt work.


 

services:
  mariadb:
    container_name: mariadb
    image: docker.io/bitnami/mariadb:latest
    environment:
      - ALLOW_EMPTY_PASSWORD=no
      - MARIADB_ROOT_PASSWORD=AzfrZEby2PKyyH59P
      - MARIADB_DATABASE=prestashop_2024
      - MARIADB_USER=user1
      - MARIADB_PASSWORD=gyeGjEZ92obHWg#Y#d7
    volumes:
      - /home/user1/bitnami/mariadb:/bitnami/mariadb
    networks:
      - prestashop-net

  prestashop:
    container_name: prestashop
    image: docker.io/bitnami/prestashop:latest
    environment:
      - PRESTASHOP_HOST=example.com
      - PRESTASHOP_TIMEZONE=Asia/Singapore
      - PRESTASHOP_DATABASE_HOST=mariadb
      - PRESTASHOP_DATABASE_PORT_NUMBER=3306
      - PRESTASHOP_DATABASE_USER=user1
      - PRESTASHOP_DATABASE_NAME=prestashop_2024
      - PRESTASHOP_DATABASE_PASSWORD=gyeGjEZ92obHWg#Y#d7
      - PRESTASHOP_FIRST_NAME=Bob
      - PRESTASHOP_LAST_NAME=Davis
      - PS_DEV_MODE=0
      - PS_DEMO_MODE=0
      - PS_FOLDER_ADMIN=admin076vwy4oc6vwy324
      - [email protected]
      - [email protected]
      - PHP_UPLOAD_MAX_FILESIZE=0M
      - PHP_MEMORY_LIMIT=512M
      - ALLOW_EMPTY_PASSWORD=no
      - PRESTASHOP_SMTP_HOST=smtp.ipage.com
      - PRESTASHOP_SMTP_PORT=587
      - [email protected]
      - PRESTASHOP_SMTP_PASSWORD=rdwKO1Xzq83HbFJ2
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.prestashop.rule=Host(`example.com`)" #This sets prestashop as the main domain
      - "traefik.http.routers.prestashop.entrypoints=websecure"
      - "traefik.http.routers.prestashop.tls.certresolver=myresolver"
    volumes:
      - /home/user1/bitnami/prestashop:/bitnami/prestashop
    depends_on:
      - mariadb
    networks:
      - prestashop-net
      - web

  phpmyadmin:
    container_name: myphpadmin
    image: phpmyadmin/phpmyadmin
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.phpmyadmin.rule=Host(`phpmyadmin.example.com`)" #This sets phpmyadmin as a subdomain
      - "traefik.http.routers.phpmyadmin.entrypoints=websecure"
      - "traefik.http.routers.phpmyadmin.tls.certresolver=myresolver"
    networks:
      - prestashop-net
      - web

networks:
  prestashop-net:
    external: true
  web:
    external: true

volumes:
  mariadb_data:
    driver: local
  prestashop_data:
    driver: local

 

Edited by bnadauld (see edit history)
Link to comment
Share on other sites

  • bnadauld changed the title to Anyone intalled ps behind a traefik reverse proxy?
  • 1 year later...

I hope you were able to resolve your issue. Here are some possible solutions you can try.

When using Traefik, keep in mind the following:

Bad Gateway: This usually means the container is not correctly connected to the Traefik network, or the container has multiple networks and Traefik cannot determine which one to use. In this case, simply add the following label:

- "traefik.docker.network=<your-traefik-network-name>"

 

404: This usually means the container is stopped or has been killed. If the container is running, you may need to add the load balancer label:

- "traefik.http.services.<your-traefik-service-name>.loadbalancer.server.port=<port-where-apache-is-running>"

For example:

- "traefik.http.services.mynewprestashopsite.loadbalancer.server.port=8000"

 

Edited by Progressify
markdown to forum visual tag (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...