services:
    db:
    image: mariadb:11.4
    container_name: ${spipDBName}
    restart: ${restartPolicy}
    env_file:
      - ../../secret/env-${spipDBName}
    volumes:
      - spipDB:/var/lib/mysql
    networks:
      - spipNet

  spip:
    image: ipeos/spip:4.4
    restart: ${restartPolicy}
    container_name: ${spipServName}
    env_file:
      - ../../secret/env-${spipServName}
    links:
      - db:mysql
    environment:
      - SPIP_AUTO_INSTALL=1
      - SPIP_DB_HOST=${spipDBName}
      - SPIP_SITE_ADDRESS=https://${spipHost}.${domain}
    expose:
      - 80
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.${spipServName}.rule=Host(`${spipHost}.${domain}`)"
    networks:
      - spipNet
    volumes:
      - spipData:/usr/src/spip

volumes:
  spipDB:
  spipData:

networks:
  spipNet:
    external: true
    name: spipNet
