membermatters / MemberMatters

An open source membership, access and payments portal for makerspaces and community groups.
https://membermatters.org
MIT License
41 stars 23 forks source link

Any problems hosting this in ECS / AWS? #130

Closed dtbaker closed 3 years ago

dtbaker commented 3 years ago

Just wondering if you can see any issues hosting this in a serverless environment such as Fargate/ECS on AWS?

I've got it deployed to members.gctechspace.org now, but to do so I had to remove the two VOLUMES from Dockerfile (logs and data).

I see the data directory was referenced for media assets in the code, but is it actually used in the system anywhere (i.e. can people upload assets and do they need to persist on the file system between deployments)?

You can follow along with the progress here: https://github.com/gctechspace/MemberMatters/pull/3

I'm just wondering if we need to put in some sort of S3 backed storage feature in order to proceed with this method of hosting.

We're basically hooking it up so that it's backed by RDS / MySQL and any time someone merges a Pull Request it will automatically deploy the changes to members.gctechspace.org

jabelone commented 3 years ago

The only thing is interlocks may take a bit longer to respond and are somewhat dependant on an active internet connection. They have some basic caching functionality, but that only really works if a user is already signed into site when internet drops out.

I see the data directory was referenced for media assets in the code

At one point there was a profile picture upload feature, but it got removed when the frontend got rewritten. It's not being used right now. I intend on implementing an integration with S3 to upload member documents, which will replace any sort of local upload handling.

I'm just wondering if we need to put in some sort of S3 backed storage feature in order to proceed with this method of hosting.

The only other thing you need, other than the docker container itself, is a persistent database host. I'd recommend an RDS instance if you go down the AWS route.

One thing that you may (not 100% sure) run into, is the current Xero integration relies on a private key to talk to the Xero API, and this needs to be located in the data volume currently. Unfortunately this is a limitation of Xero, and their awful API. If you're not using the Xero integration, this probably won't be a problem.

jabelone commented 3 years ago

Just wondering if you can see any issues hosting this in a serverless environment such as Fargate/ECS on AWS?

Just to add, this will probably work fine, but it may end up being simpler/more flexible if you just use a standard EC2 instance and run the Docker container on it. Entirely up to you and your needs however. 🙂

dtbaker commented 3 years ago

Nice thanks!!

Great we'll run with this until we hit issues and then look at potentially hosting it locally on unraid or on an ec2 if we need more flexibility.

Commands we used to setup the infra + RDS database + deployment pipeline are here: https://github.com/gctechspace/MemberMatters/blob/infrastructure/infrastructure/README.md

Almost there :crossed_fingers:

jabelone commented 3 years ago

Nice! Feel free to PR those changes back into mm/main as others may find them useful too. It probably makes sense to move the current content of the getting started page into a separate "on a linux server" page, add your "on AWS" page, then link to them from the getting started page.