Running Appwrite on balena #1046
edorgeville
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
This is amazing! Would balena allow us to use a custom docker-compose file that has a different name? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I managed to run Appwrite on the balena ecosystem (balenaOS + balenaCloud) with some modifications.
Here are my findings:
First things first
Checkout the ARM branch:
git clone https://github.com/appwrite/appwrite cd appwrite git checkout feat-465-add-arm-support
Fixing what's broken
Multiple issues arise when trying to
balena deploy
to balenaCloud:Docker compose version 3 is unsupported
Simple fix, doesn't seem like Appwrite depends on any v3 features
Bind mounts are disallowed
Current bind mounts are either the docker daemon or development mounts. All can be commented out, docker daemon can be mounted using a balena-specific service label
io.balena.features.balena-socket
:docker-compose.yml diff
Variable interpolation doesn't work
mariadb
service uses variable interpolation, which doesn't work on balena. Instead, we will add those as seperate environment variablesLine 396:
Disabling ClamAV
From @kodumbeats' tutorial:
Resulting
docker-compose.yml
docker-compose.yml
Creating the balena app and adding environment variables
balena doesn't support
.env
. Instead, those variables have to be either defaulted directly in thedocker-compose.yml
file,Dockerfile
, or they can be managed granularly on balenaCloud using either the CLI or dashboard. Here we set those variables using the CLI:commands
Publish
This steps took about 30 minutes. It uploads the full working directory (except for .dockerignored files), builds all the containers and stores them in its own registry
Add a device
Add a device using the dashboard. It will dowload all prebuilt images.
Navigate to the IP address of the device to see the landing page.
You can also access it through the balena public URL for out of network access without any additional configuration.
Next steps
Prebuilt images
Publishing prebuilt images to dockerhub will save the user from the 30 minutes build time, which would be pretty great 😁
One-click button
balena added support for a one-click button back in september. This would allow anyone with a Raspberry Pi 4 to deploy an Appwrite instance and get started in minimal time.
Looking at the docs, it would be pretty trivial to port the previous steps into a single
balena.yml
file. No CLI commands, no cloning, just one click 🎉One blocker I see is that there is no way to specify another
docker-compose.yml
. The changes todocker-compose.yml
previously described would either have to be applied on themaster
branch, or maintained in a seperate branch with only those changes. I don't know the implications of either of those solutions though.Beta Was this translation helpful? Give feedback.
All reactions