Plesk Onyx部署Rocket.Chat后遇图像识别及配置变量问题求助
Hey there! Let's work through your avatar resize problem and confirm the fix for that environment variable quirk you found.
First: Confirming Your Environment Variable Fix
You nailed the Accounts_AvatarStorePath issue! Rocket.Chat expects all environment variables to be all uppercase (so ACCOUNTS_AVATARSTOREPATH is the correct name—note the typo fix from your original ACCOUNTS_AVATARSOREPATH too). Deleting the lowercase variable was the right call, since mismatched case will prevent the system from reading the config properly. Great catch on that!
The Real Issue: ImageMagick/GraphicsMagick in the Container
The avatar resize error happens because you installed ImageMagick/GraphicsMagick on your host server (Ubuntu 16.04), but Rocket.Chat is running inside an isolated Docker container. Containers don't automatically inherit tools from the host—you need to install the image processing tools inside the Rocket.Chat container itself.
Fix 1: Install Tools in a Running Container (Temporary)
This works for quick testing, but changes will be lost if you restart or recreate the container:
- Enter the Rocket.Chat container shell:
docker exec -it rocketchat bash - Switch to root user (since we need to install packages):
su root - Update package lists and install ImageMagick (or GraphicsMagick):
apt update && apt install -y imagemagick # Replace with `graphicsmagick` if you prefer that tool - Exit the container and restart Rocket.Chat to apply changes:
exit docker restart rocketchat
Fix 2: Build a Custom Rocket.Chat Image (Permanent)
For a long-term solution, create a custom image that includes the image processing tools—this way, the tools stay even if you restart or rebuild the container:
- Create a file named
Dockerfilewith these contents:FROM rocket.chat:latest USER root # Install ImageMagick (swap to graphicsmagick if needed) RUN apt update && apt install -y imagemagick && rm -rf /var/lib/apt/lists/* USER rocketchat - Build your custom image:
docker build -t my-custom-rocketchat . - Stop and remove your existing Rocket.Chat container:
docker stop rocketchat && docker rm rocketchat - Start a new container using your custom image (keep the
--link dbparameter to maintain database connectivity):docker run --name rocketchat --link db -d my-custom-rocketchat
Plesk-Specific Note
If you prefer using Plesk's UI instead of the command line:
- For the temporary fix: Use Plesk's Docker container management to open a terminal session inside the Rocket.Chat container, then run the same install commands.
- For the permanent fix: Import your custom built image into Plesk's Docker registry, then deploy a new container from that image with the same database linking configuration.
Once you've installed the tool inside the container, Rocket.Chat should detect it automatically, and the avatar resize functionality will work as expected.
内容的提问来源于stack exchange,提问作者Antony Palmer

