Docker app installer

install_workerman3524_base_docker.sh

Creates app and logs directories, writes sample app/composer files only if absent, and overwrites Dockerfile on every run. Builds from mutable PHP 7.2/Composer tags before force-replacing the named container; only logs is mounted.

One-liner

curl -fL 'https://www.helper.sh/install_workerman3524_base_docker.sh' -o './install_workerman3524_base_docker.sh'

This command downloads the bundled file only; it does not run it. Inspect the saved source and compare its version before deciding whether to execute it.

Check the file you downloaded

Compare a saved file with the exact bytes bundled in this page’s build. The file stays in this tab; this tool does not upload or persist it. Maximum 2 MiB.

Expected SHA-256
e3f40b68c2dc6cc4c865d7498000d73352f373a589362c141e485e3567f7bbb4

Bundled byte count: 5729

Save checksum file

Save the script and checksum in the same directory. On Linux with GNU Coreutils, the command below checks the saved bytes only; it does not run the script. Keep the original filename for this command.

sha256sum --check './install_workerman3524_base_docker.sh.sha256'

No comparison yet.

The checksum and script come from the same site, not an independent signature. A match does not prove safety, authenticity of upstream dependencies, or suitability for your host. Mutable remote dependencies need separate review.

Read validation and limitations

Requirements

  • Linux host
  • Docker installed and running
  • root privileges or sudo
  • Port 2345 available
  • /data writable on the host

Best for

  • Bring up a simple Workerman 3.5.24 HTTP service quickly on a Docker-ready host
  • Keep Workerman application files and logs under /data/workerman3.5.24 on the host
  • Provide a reviewed bootstrap path for older event-driven PHP services that still depend on Workerman 3.x

Highlights

  • Creates /data/workerman3.5.24/app and logs automatically
  • Writes a minimal Workerman bootstrap and composer.json by default
  • Builds a local helper-workerman:3.5.24 image from php:7.2-cli
  • Starts a restartable container and exposes a simple HTTP endpoint for validation

Recommended procedure

  1. Confirm Docker is already installed and the host can expose port 2345.
  2. Run the helper.sh command with sudo or as root.
  3. Let the script prepare /data/workerman3.5.24, build the local image, and create the container.
  4. Edit the sample Workerman application under /data/workerman3.5.24/app and rebuild or replace it later when you move to a real service.

Safety notes

  • Workerman 3.x and PHP 7.2 are both legacy components. Use them only when application compatibility requires it.
  • Do not expose an event service built from legacy PHP directly to the public internet without traffic controls and review.
  • Back up /data/workerman3.5.24 before replacing or rebuilding a production container.

Compatibility and limits

  • Requires Linux with systemd, Docker build support, root, writable /data and the selected free host port (2345 by default). This is a legacy Workerman 3.5.24/PHP 7.2 compatibility example; PHP 7.2 is unsupported.
  • Accepts --data-dir, --container-name and --port. No dry-run, backup or automatic rollback. php:7.2-cli and composer:2.2 are mutable upstream tags. The generated Dockerfile disables archive metadata expiry checks and allows insecure APT repositories inside the image build.
  • Only composer.json is copied before composer install, so a host composer.lock does not pin that installation stage. An existing composer.json is retained and can change the requested Workerman version. Re-check dependencies when upstream bytes change.

Files, services, and data affected

  • Creates /data/workerman3.5.24/app and logs; writes app/start.php and composer.json only if absent. Overwrites DATA_DIR/Dockerfile on every run without a backup, including custom edits.
  • Builds helper-workerman:3.5.24 first, then force-removes a same-name container and starts its replacement with the chosen host port mapped to container 2345. Only logs is bind-mounted; application files are copied into the image. Host app edits require a rebuild and replacement.
  • Reuses host files without backup. A mounted logs directory does not ensure custom application logging writes there. No TLS or public access restriction is configured.

Read-only verification

  • Substitute custom names/paths if used. Inspect `docker inspect workerman3524 --format '{{json .Mounts}} {{json .HostConfig.PortBindings}}'`, `docker ps --filter name=workerman3524`, and `docker logs --tail 100 workerman3524`.
  • Check `docker exec workerman3524 php -v` and `docker exec workerman3524 composer show workerman/workerman` for the actual runtime and installed package version.
  • For the unchanged sample, verify its loopback HTTP response separately. A successful curl status is not application validation; custom request handlers need their own reviewed checks. The script warns and still prints completion when HTTP readiness fails or curl is missing.

If it fails

A build failure occurs before the old named container is removed, but Dockerfile may already be overwritten. Preserve host files and existing image/container evidence; inspect dependency and archive errors. After replacement failure, check port conflicts, image version and logs before another rebuild. Back up custom Dockerfile and app files; the script cannot restore the previous container automatically.

PHP · Composer

Download, inspect, then verify the version before execution. A hash only identifies these exact bytes; it does not prove safety. Piped commands run remote content immediately, and upstream dependencies can change.

Scenario article

Why host app edits do not update the Workerman container

Distinguish build inputs from live mounts in the bundled Workerman example, preserve custom Dockerfiles, and verify which image and package the container actually runs.

Related topics

Docker services: check the interface and retained state

Choose by protocol, data directory and replacement impact: HTTP, SQL, cache, FastCGI or an image-baked application.

Open topic

Legacy PHP: separate runtime compatibility from application readiness

Use PHP 7.2 and Workerman 3.5.24 examples for inherited compatibility work with an upgrade plan.

Open topic

Problem pages

Workerman says completed but HTTP readiness failed

Separate build, container startup, the optional curl probe and application validation before another replacement.

Open page