Operate Docker
หมายเหตุ: บทความนี้ยังเป็นภาษาอังกฤษ เนื่องจากคำแปลภาษาไทยกำลังอยู่ระหว่างจัดทำ
Audience
หัวข้อที่มีชื่อว่า “Audience”Docker operators and framework administrators.
Prerequisites
หัวข้อที่มีชื่อว่า “Prerequisites”Docker Compose access to the EmuFramework installation.
Common commands
หัวข้อที่มีชื่อว่า “Common commands”docker compose up -ddocker compose stopdocker compose startdocker compose psdocker compose logs --tail=200 appdocker compose logs --tail=200 updaterdocker compose pullUse docker compose stop (or docker compose down) rather than killing the containers. On a graceful stop the app checkpoints and closes both SQLite databases. docker compose down removes the containers and network; the named volumes (data, files, and archive) remain. Never add -v unless deleting all application data, attachments, and the archive is intentional.
Verify the updater
หัวข้อที่มีชื่อว่า “Verify the updater”The updater is intentionally not exposed on a host port. It is reached only by the app over the Compose network:
http://updater:3400Both images define a container health check, so docker compose ps shows healthy for each service when it is ready. The app is checked at /api/health and the updater at /health (port 3400, inside the container). The updater’s /health returns {"ok":true,"busy":false}; busy is true while an update or restore is running.
Check both services and their logs:
docker compose psdocker compose logs --tail=100 appdocker compose logs --tail=100 updaterConfirm that the app, rather than only the updater, has the required settings:
docker compose exec app printenv EMU_DEPLOYMENT_MODEdocker compose exec app printenv EMU_UPDATER_URLExpected values are docker and http://updater:3400. Confirm the storage paths match the volumes the updater mounts:
docker compose exec app printenv EMU_FILE_STORAGE_PATH EMU_ARCHIVE_STORAGE_PATHdocker compose exec updater printenv EMU_FILE_STORAGE_PATH EMU_ARCHIVE_STORAGE_PATHRecreate the app after changing .env:
docker compose up -d --force-recreate appDocker Desktop checks
หัวข้อที่มีชื่อว่า “Docker Desktop checks”When containers were created manually in Docker Desktop, verify that both containers share a user-defined network and that the app has a /data volume. The updater must have access to /var/run/docker.sock; this grants host-level Docker control and should be treated as a high-privilege component. See Docker installation for the exact connectivity test command for manually created containers.
Update status states
หัวข้อที่มีชื่อว่า “Update status states”A successful update moves through this status sequence, tracked in the file set by EMU_UPDATE_STATE_PATH (default /data/update-status.json):
pending -> running -> restarting -> succeededThe same file records a phase that advances through preparing, stopping, snapshotting, switching, verifying, and completed. A failed update ends in rolled_back (with rollbackStatus succeeded) or recovery_required (with recoveryRequired true). Restores use the file set by EMU_RESTORE_STATE_PATH (default /data/restore-status.json) and add a restoring phase. See Update the framework and Recover from a failed update.
Diagnose fetch failed during update checks
หัวข้อที่มีชื่อว่า “Diagnose fetch failed during update checks”Common causes, roughly in order of likelihood:
- The app and updater containers are not on the same Docker network.
- The updater container is missing the network alias
updater. - The app’s
EMU_UPDATER_URLis nothttp://updater:3400. EMU_UPDATER_TOKENdiffers between the app and the updater.- The updater is not mounting
/var/run/docker.sock. - The updater is not mounting
emu-dataat/data. EMU_APP_CONTAINERdoes not match the app container’s actual name (the default isemuframework-app).
If the update starts but fails immediately with Persistent mount ... differs between app and updater, the updater and the app do not share the same /files or /archive volume. Compare them with docker inspect on both containers and recreate with Compose.
Manual rollback
หัวข้อที่มีชื่อว่า “Manual rollback”A failed web update rolls back automatically, including the data snapshot. Use this procedure only to go back after an update that succeeded.
- Keep the verified pre-update backup.
- Set
EMU_VERSIONin.envto the previous known-good stableX.Y.Zversion. - Run
docker compose pull && docker compose up -d. - Restore databases only when a documented migration requires it; switching the image back does not alter database files.
Related topics
หัวข้อที่มีชื่อว่า “Related topics”Docker installation · Database storage · Framework update · Recovery