- Newest
- Most votes
- Most comments
" how a multi-container app can be deployed on Lightsail container service" well I don't want to host a multi-container app, i want to host multiple small apps under one container-service.
This is the lightsail API i'm referring to: https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/Welcome.html
This allows you, in theory, to send commands to AWS outside of the ClI from your own computer. so i could send a request from an app. you evidently send a json in the request using GET or POST as specified in the api. but the json doesn't have authentication details so they'll just act on any request coming in? i could get a nice vps for $15 a month just trying the aws option
{ "containers": { "string" : { "command": [ "string" ], "environment": { "string" : "string" }, "image": "string", "ports": { "string" : "string" } } }, "publicEndpoint": { "containerName": "string", "containerPort": number, "healthCheck": { "healthyThreshold": number, "intervalSeconds": number, "path": "string", "successCodes": "string", "timeoutSeconds": number, "unhealthyThreshold": number } }, "serviceName": "string" }
Did you give the video a try? I'd recommend doing that since my terminology may not have matched yours, but the video still might turn out to be useful.
===
I am familiar with Lightsail API :) What I meant was I couldn't clearly understand how you intend to use it or why would you need to, from the description of your idea.
===
wrt,
but the json doesn't have authentication details so they'll just act on any request coming in
, not quite, the authentication is set in the request headers and unauthenticated requests generate an error response to that effect.Please refer https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html for how to configure credentials for AWS CLI calls.
Hi,
I am not sure I was able to follow the "making lightsail api requests" part, or the "how would api be validated" piece of your post.
However this video - https://www.youtube.com/watch?v=6S2brobgmBA&t=1921s from the Lightsail team demo's how a multi app setup can be deployed on Lightsail container service and will likely help guide you.
Attaching a screenshot of the video paused to show what the link links to :)
Thanks.
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 9 days ago
I haven't done Flask app programming in a while, but I recall it being pretty modular and composable. E.g. you could probably just have one container service that has all your apps sitting on separate URL routes, like: /portfolio/app1, /portfolio/app2, /portfolio/app3, ...
that would involve a lot of work but maybe. throw all the static resources together, all the templates together, etc. multiple apps have an 'index.html' template and so i would have to rename these, and some inherit from a base.html and i would have to work that out etc. Then i would have to figure out how to handle the various route requests (every app has '/' -- i would have to work that out). i don't know i'm not a master of flask so maybe there's a way to do this i'll look into it. thanks for your comment [2nd edit] wow, 'master' is a non-inclusive word. but i was saying i'm NOT a master!
Here's a post that has an example of how to do this. The author even has exactly same purpose for this as you: portfolio site! https://peterhaas-me.medium.com/how-to-run-multiple-flask-applications-from-the-same-server-9ca2c0ad7bb3
TL;DR: https://werkzeug.palletsprojects.com/en/2.0.x/middleware/dispatcher/
Pavel that looks great but I would have to pay Medium $50. Not just now ;) I'm currently going to look into nginx and see if I can have that redirect requests to a different port based on the url. But i don't really know how that would work. if you were willing to engage in some light copyright infringement you could send the story to me at myspam@cambiumsoftware.com