version: '3'

services:

  mywww:
    image: bunkerity/bunkerized-nginx
    restart: always
    ports:
      - 80:8080
      - 443:8443
    volumes:
      - ./prestashop-files:/www:ro
      - ./letsencrypt:/etc/letsencrypt
      - ./server-confs:/server-confs:ro         # custom confs at server context for prestashop
    environment:
      - SERVER_NAME=www.website.com             # replace with your domain
      - AUTO_LETS_ENCRYPT=yes
      - REDIRECT_HTTP_TO_HTTPS=yes
      - DISABLE_DEFAULT_SERVER=yes
      - MAX_CLIENT_SIZE=50m
      - USE_CLIENT_CACHE=yes
      - USE_GZIP=yes
      - REMOTE_PHP=myprestashop
      - REMOTE_PHP_PATH=/var/www/html
      - LIMIT_REQ_RATE=5r/s
      - LIMIT_REQ_BURST=10

  myprestashop:
    image: prestashop/prestashop:1.7-fpm
    restart: always
    volumes:
      - ./prestashop-files:/var/www/html
    environment:
      - DB_SERVER=mydb
      - DB_NAME=prestashop
      - DB_USER=user
      - DB_PASSWD=db-user-pwd                    # replace with a stronger password (must match MYSQL_PASSWORD)
      - PS_INSTALL_AUTO=1
      - PS_DOMAIN=www.website.com                # replace with your domain
      - PS_FOLDER_ADMIN=myadmin                  # replace with your admin folder
      - PS_ENABLE_SSL=1
      - ADMIN_MAIL=admin@website.com             # replace with your mail
      - ADMIN_PASSWD=admin                       # replace with a stronger password

  mydb:
    image: mariadb
    restart: always
    volumes:
      - ./db-data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=db-root-pwd         # replace with a stronger password
      - MYSQL_DATABASE=prestashop
      - MYSQL_USER=user
      - MYSQL_PASSWORD=db-user-pwd              # replace with a stronger password (must match DB_PASSWD)
