Cache gem installations in Dockerfile.
Upgrade psych to avoid libyaml vulnerability.