2 years ago
I am aware that if we want to pass a service variable to a container during the build stages, we have to use ARG, but in my case the running app only needs it. How would I do this?
54 Replies
2 years ago
for a Dockerfile build, just dont use ARG in your Dockerfile and the variables will not be available during build!
Yeah, but will they be available during runtime? I'm running into that issue
2 years ago
yes they will
2 years ago
from your deploy logs -
RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set.and unless I'm blind, you do not have either of them set
2 years ago
that could do it
2 years ago
just wanna let you know that you are subjecting yourself to egress fees and slower networking by having the database in a separate project and connecting to it via the public network
This is kinda weird but I have a singular database that is connected to by multiple projects
2 years ago
🙂
2 years ago
not ideal tbh, you'd want an induvial database in each project
2 years ago
you pay in egress and slower networking
2 years ago
databases have always been ran in containers though? im not sure what you mean, sorry
Awhile back there was some old version of databases and they had to get everyone to migrate
2 years ago
yeah they where still containers, we just didnt charge for egress or storage back then
Since then it was pretty cheap to run DBs per project, but since then I combined the databases into a singular one
2 years ago
postgres uses much less idle resources btw
2 years ago
im telling you this because i've seen too many people ask the "why do i have a $200 in egress my application doesnt get much traffic" question and i dont want that to be you
2 years ago
$200 was just an example, you are connecting to the database publicly, theres always the possibility of some rouge code generating a lot of traffic to your database
Example: 98e650c9-d0c2-42e7-9e30-641d0e0cabbf
Connects to Redis through its public URL even though I have them in the same instance
2 years ago
the potential for a large egress bill and the much slower networking is not worth the immediate cost savings of a single separate database
2 years ago
thats clutter though and not scalable
2 years ago
you hardcoded the url to the public url for redis
2 years ago
like i mentioned, there is always the possibility your code does something and generates a lot of egress to the database, many such cases
2 years ago
of course you do what you think is best, i just don't want us to have to tell you that you indeed need to pay that random unexpected $200 bill for egress
2 years ago
to postgres? 😉
2 years ago
your mysql idles at ~500mb of memory with 410mb of used volume, i have a postgres database that has ~7gb of used volume and idles at 105mb.
2 years ago
maybe thats enough to convince you
Btw, is this how I would create a proper reference?
When I click add, the template gets replaced with the actual URL

I'll start converting 🫡
Luckily most of these are using Sequelize or other ORMs so I should be able to just switch the connector, but I think there's a couple projects that are a little more involved
2 years ago
!s
Status changed to Solved brody • over 1 year ago


