I'm trying to instantiate a appwrite server on GCP, VMs have the option to run a container on bootup, you can setup container environment variables and entrypoint command with its arguments, right now whenever I start the VM it's pulling the the image and running the install command but since this command is interactive and the vm is not giving it a STDIN, it's using default values for everything, so I was thinking if a feature could be added to the install command where, when giving the --env flag, it skips the interactive part and looks for environment variables matching the list of known environment values used by appwrite
Tell install
command to use environment variables
what exactly is your goal?
Instantiate appwrite on a GCP VM using the built in container deployment tool
i don't know if that's really a good idea...if your goal is to have an image with appwrite, perhaps you can just have the docker files on the server already
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
-e _APP_ENV=production \
-e _APP_DOMAIN=domain \
-e _APP_OPENSSL_KEY_V1=very-secret-key \
-e _APP_DOMAIN_TARGET=domain \
-e _APP_SMTP_HOST=smtp.gmail.com \
-e _APP_SMTP_PORT=465 \
-e _APP_SMTP_SECURE=ssl \
-e _APP_SMTP_USERNAME=username \
-e _APP_SMTP_PASSWORD=password \
--entrypoint="install" \
appwrite/appwrite:1.2.1 \
--env
I'm looking for something like this, so the install command runs non-interactively and I can use the container deployment of GCP's VMs
https://github.dev/appwrite/appwrite/blob/e8c74d7204258133a61db09ed518211170e751d9/app/tasks/install.php#L111
I believe this is done here, so instead of loading the /.env
file, if the --env
argument is passed, search in the environment for the variables
again i really want to focus on what your end goal is...not trying to add env vars to the install command
Use this to run appwrite on a GCP VM
in order to what?
Use appwrite on a GCP VM π
you can do that by just running the install manually....so what is it do you really need?
Doing this would be a more production-friendly approach, instead of creating the VM, ssh-ing, running the docker command,
so your end goal is to be able to start up a VM and already have appwrite installed
what other ways can you configure a GCP VM? can you run a script on first launch?
Yes, it can run scripts at launch
so you can write a script that:
- Creates
appwrite
folder - Downloads this into the folder: https://appwrite.io/install/compose
- Downloads this into the folder: https://appwrite.io/install/env
- Updates any .env vars as necessary
- Runs
docker compose up -d
to startup appwrite
Hmm I still believe it would be more clean to just have the install command accept environment variables then creating a script with more moving parts, I have no problem working on that feature if you believe it has a chance of getting merged π
i haven't seen any other requests like this so it doesn't seem like it would be very high in priority. you can submit an issue if you'd like
Recommended threads
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...
- Unauthorized Charge After Appwrite Pro F...
I was using Appwrite Pro credits worth $100, which were valid until November. During this period, I was exploring Appwrite's services. However, I recently notic...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...