W
Wasp-lang5mo ago
mm

Switching wasp version, and/or running in Docker

Is there a way to switch wasp version, just like nvm for example? I can't seem to find anything from the docs -> https://wasp-lang.dev/docs/general/cli#miscellaneous-commands Have anyone tried running everything inside a docker container? based from my understanding only the database is ran in docker
8 Replies
MEE6
MEE65mo ago
Wohooo @mm, you just became a Waspeteer level 1!
kapa.ai
kapa.ai5mo ago
Hi @mm. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, there is a way to switch Wasp versions. You can use the installer script to install a specific version of Wasp. The command to do this is:
curl -sSL <https://get.wasp-lang.dev/installer.sh> | sh -s -- -v x.y.z
curl -sSL <https://get.wasp-lang.dev/installer.sh> | sh -s -- -v x.y.z
Replace x.y.z with the version number you want to switch to. You can check the list of valid versions on the Wasp GitHub releases page (https://github.com/wasp-lang/wasp/releases). This command will download the specified version if it's not already on your system, and your system will use that version of Wasp from that moment on[^1^]. As for running everything inside a Docker container, there has been some discussion about this in the Wasp community. Currently, only the database is run in Docker[^2^]. There are some performance concerns about running the entire Wasp stack in Docker, especially on non-Linux systems[^3^]. However, the idea of completely dockerizing the Wasp app is still being considered[^4^]. ^1^]: [Github Issue (open): Make process of updating Wasp nicer > Comments Part 1 (https://github.com/wasp-lang/wasp/issues/616) ^2^]: [Github Issue (open): wasp start db should allow switching port > Original post (https://github.com/wasp-lang/wasp/issues/1858) ^3^]: [Github Issue (open): Completely dockerize Wasp app > Comments Part 5 (https://github.com/wasp-lang/wasp/issues/172) ^4^]: [Github Issue (open): Completely dockerize Wasp app > Comments Part 2 (https://github.com/wasp-lang/wasp/issues/172) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @mm, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
IamIconLiving
IamIconLiving5mo ago
You can create your own docker file that runs everything
martinsos
martinsos5mo ago
Yeah you should be able to although I haven't done it myself. We had a person say they have such docker container,just a couple of days ago, but they haven't shared it yet: if they do that would be a good thing to look at. Right now, just run wasp version and you will see the instructions for installing different versions of Wasp. To switch the version, just run the installation command -> it is smart, will figure out you already have Wasp installed and will just switch to it. It is not the most convenient way, but works. To simplify this you could have setWasp.sh script in your project that runs that command for you so you can just run ./setWasp.sh and that is it. btw this will change version of Wasp globally, on whole machine, persistently, so it will stay the same after machine restart. You could combine this with https://direnv.net/ for seamless experience, so it runs this script for you when you enter the project's dir -> I never tried this but it should work.
direnv
direnv – unclutter your .profile
unclutter your .profile
mm
mmOP5mo ago
Sorry bout that I should've tried it first before asking. Thank you for the suggestion but I think creating an alias is the most convenient one alias waspvm='curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v' just like nvm lol.
martinsos
martinsos5mo ago
@mm that is also a nice solution! By having a script per project you can additionaly avoid having to check for each project which wasp version it is
mm
mmOP5mo ago
my bad I didn't read your message thoroughly been super busy. Yes that is a better solution. just have a script in the project. I will do that instead thanks! I will name it .wasprc
martinsos
martinsos4mo ago
Ha cool
Want results from more Discord servers?
Add your server