[Rails] Dockerfile generator with --swap option is not compatible with fly volumes

I followed Sqlite3 on fly volumes tutorial and proactively enabled swap for demo rails app.

It turned out that, since the container is launched as root user when swap is on, fly mounts volumes for root too:
Mounting /dev/vdb at /mnt/volume w/ uid: 0, gid: 0 and chmod 0755

then entry-point script substitutes user for rails server command with rails user:

rendering mounted volumes un-accessible for rails user.

You may need the --root option. Either that or to manually add lines to the docker-entrypoint prior to line you highlighted that changes the ownership some or all of the directories on the volume.

Note: this is true whether or not you have enabled swap. Now I see. Defining swap is only possible as root, and that changes the ownership of the volume. At the moment, dockerfiles-rails is unaware of volume mounts so it can’t correct this. The options listed above are the only options at the moment.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.