a year 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
a year 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
a year ago
yes they will
a year 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
a year ago
that could do it
a year 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
a year ago
🙂
a year ago
not ideal tbh, you'd want an induvial database in each project
a year ago
you pay in egress and slower networking
a year 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
a year 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
a year ago
postgres uses much less idle resources btw
a year 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
a year 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
a year 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
a year ago
thats clutter though and not scalable
a year ago
you hardcoded the url to the public url for redis
a year 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
a year 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
a year ago
to postgres? 😉
a year 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.
a year 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
a year ago
!s
Status changed to Solved brody • about 1 year ago


