You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'm working on an app as part of my experiments with Remix and while overall experience integrating Mikro ORM with the framework is easy, when I started to work on docker image (as a way to distribute app releases and demos) I realized I have no idea how can I deliver migrations with my app, and how can I make them available for local demos. The way I put it is that I need to include them into Docker image, but during the build process (as you can see tell from the build and run layers) the app's source code is left behind, and because everything is bundled in one file (the backend) and bunch of static assets (the frontend) there's no way I can access database config, nor migrations. The way I could fix this problem would be to just run separate tsc or some bundler (like esbluild since I already have it in my project) build step so I can create an entry point for Mikro ORM CLI to manage up/down migrations. But then if I do so the other problem arises: It seem to me that Mikro ORM requires a list of entities and it should have at least one entity it it and I don't think it would be a good idea to include entities into that second bundle, because they can drag too much code and unnecessarily increase the side of the image. So, the question is there any commendations for such kind of applications on how to distribute migrations with the app releases if I use Docker?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi. I'm working on an app as part of my experiments with Remix and while overall experience integrating Mikro ORM with the framework is easy, when I started to work on docker image (as a way to distribute app releases and demos) I realized I have no idea how can I deliver migrations with my app, and how can I make them available for local demos. The way I put it is that I need to include them into Docker image, but during the build process (as you can see tell from the build and run layers) the app's source code is left behind, and because everything is bundled in one file (the backend) and bunch of static assets (the frontend) there's no way I can access database config, nor migrations. The way I could fix this problem would be to just run separate tsc or some bundler (like esbluild since I already have it in my project) build step so I can create an entry point for Mikro ORM CLI to manage up/down migrations. But then if I do so the other problem arises: It seem to me that Mikro ORM requires a list of entities and it should have at least one entity it it and I don't think it would be a good idea to include entities into that second bundle, because they can drag too much code and unnecessarily increase the side of the image. So, the question is there any commendations for such kind of applications on how to distribute migrations with the app releases if I use Docker?
Beta Was this translation helpful? Give feedback.
All reactions