Home

Awesome

DOCKER-PHP-WECHATY-GETTING-STARTED

Powered by Wechaty Docker Pulls Docker Stars Docker CI PHP Wechaty

dockeri.co

Getting Started Template for Docker Users

FEATURES

  1. PHP Wechaty is fully dockerized. So it will be very easy to be used as a MicroService.
  2. Clone this repository, then you will be able to use Docker to run PHP Wechaty with ZERO configuration.

REQUIREMENTS

  1. Docker
  2. Global Internet Connection

USAGE

Run Bot Examples

1. Run PHP Example with no tls

Source code at examples/ding-dong-bot.php

./quick_start.sh

2. Run PHP Example with tls

Source code at examples/ding-dong-bot.php

./quick_start_tls.sh

3. Run PHP Example with docker-compose and no tls

Source code at examples/ding-dong-bot.php

./docker-compse-start.sh

4. Run PHP Example with docker-compose and tls

Source code at examples/ding-dong-bot.php

./docker-compse-start-tls.sh

New environment variables

<!-- markdownlint-disable MD013 -->
  1. WECHATY_PUPPET_SERVICE_TLS_CA_CERT: can be overwrite by options.tlsRootCert. Set Root CA Cert to verify the server or client.

For Puppet Server:

Environment VariableOptionsDescription
WECHATY_PUPPET_SERVICE_TLS_SERVER_CERToptions.tls.serverCertServer CA Cert (string data)
WECHATY_PUPPET_SERVICE_TLS_SERVER_KEYoptions.tls.serverKeyServer CA Key (string data)
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVERoptions.tls.disableSet true to disable server TLS

For Puppet Client:

Environment VariableOptionsDescription
WECHATY_PUPPET_SERVICE_AUTHORITYoptions.authorityService discovery host, default: api.chatie.io
WECHATY_PUPPET_SERVICE_TLS_CA_CERToptions.caCertCertification Authority Root Cert, default is using Wechaty Community root cert
WECHATY_PUPPET_SERVICE_TLS_SERVER_NAMEoptions.serverNameServer Name (mast match for SNI)
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENToptions.tls.disableSet true to disable client TLS

Learn more about tls at https://github.com/wechaty/puppet-service

DOCKER

Install Docker

Quick & easy install Docker via:

curl -sSL https://get.docker.com | sh

Or

wget -qO- https://get.docker.com/ | sh

Get to know more about Docker at: https://www.docker.com/

TEST

BATS: HOW TO USE BATS TO TEST YOUR COMMAND LINE TOOLS

SEE ALSO

  1. PHP Wechaty Getting Started: https://github.com/wechaty/php-wechaty-getting-started

HISTORY

v0.1 (Nov 23, 2021)

Init docker support.

AUTHOR

@zhangchunsheng - Chunsheng Zhang (张春生)

COPYRIGHT & LICENSE