simplerisk / docker

SimpleRisk Docker Repository
https://www.simplerisk.com
Mozilla Public License 2.0
26 stars 20 forks source link

The image bug #52

Closed jfucanada closed 1 year ago

jfucanada commented 1 year ago

This image can’t be compatible with the user having the extras folder (for those paid features) under /var/www/simple risk. It will failed to upgrade process after importing the DB backup from old system. Dorian knows more details.

jsokol commented 1 year ago

While I understand your frustration, this is not a Docker issue. Dockers are intended to be immutable and the SimpleRisk software runs inside of a persistent volume on these containers. The 20230106-001 release represents a shift from PHP 7 to PHP 8.1, which requires that your old Docker be terminated and a new Docker created in order to have the proper PHP 8 environment. As long as you have not modified our Docker image, the SimpleRisk code, paid for Extras and database will all persist for that upgrade. If you have modified our Docker image, then I'm afraid we are unable to support a non-standard Docker image configuration and I would, unfortunately, expect there to be issues with upgrading.

jfucanada commented 1 year ago

I did use the Dockerfile provided by your repos. I didn’t customize it. It doesn’t include /extras folders at first place. I have no clue what’s going on.

jsokol commented 1 year ago

The Dockerfile would not include the /extras file because those files are part of the paid version and the Docker is build with the SimpleRisk Core. That said, the simplerisk/extras file is placed under /var/www/simplerisk, which is defined as a persistent VOLUME for the Docker container:

https://github.com/simplerisk/docker/blob/master/simplerisk/jammy/Dockerfile#L106

The Extras, once purchased, would be placed into that persistent volume and would persist upon updating the Docker container. I looked back through Docker releases over the past year (back to the 20220122-001 release) and that volume has been defined as persistent at least since then:

https://github.com/simplerisk/docker/blob/8fc5a58e59ecdbf9424085b14538f29443d8378a/simplerisk/focal/Dockerfile#L109

The only thing that I can think of for your particular situation is that instead of spinning up a new container with the same persistent VOLUME, you spun up a new container and created new VOLUMEs for it. This would explain why the /extras directory did not exist and why you had to migrate the MySQL database instead of just being able to use the existing one with the new container.

Here are a couple of useful links for how persistent volumes work in Docker:

Next time you will likely want to make sure you specify using those existing volumes when you bring up the new container. If you have any further questions, please don't hesitate to reach out to Support.

jfucanada commented 1 year ago

We were recreating all persistent volumes and starting a new container with a fresh image, without considering our paid components. This resulted in the loss of the extras folder, where the paid items were stored. We will work with your support tomorrow to manually set up the paid items through the GUI and import the old database backup, followed by running the upgrade script in the GUI to resolve this issue.

jsokol commented 1 year ago

Assuming you were using the official Docker image before, and had not made modifications to it, the persistent volumes are there. You simply need to either mount them to your new image or make a copy of them and mount those, instead. The links I provided in my last response should help you with that process.

As a reminder, our Support team is an expert on SimpleRisk, but for an On-Premise deployment, you are supposed to be the expert on your chosen environment. We will do our best to support you in that endeavor, but with Docker images intended to be ephemeral, you should be sure that you understand what that means from both a provisioning and an upgrade standpoint. With Docker, you are not "upgrading" the container, per se, you are destroying it and bringing a new one up in its place with whatever updates need to be there. The volumes are how you persist data from one container to the next, but based on your explanation, you did not follow the process to migrate the volumes to the new image. Yes, Support can certainly help to install a new version of SimpleRisk, download the Extras, migrate the database, etc, but this is NOT the way that you upgrade a Docker system. I'd ask that you please read the links above so that you have a firm understanding of how Docker volumes work prior to Support helping with any further actions on this system.