
Ask HN: When do you containerize new projects? - jamesmaniscalco
When you spin up a new project, how far do you go into containerization and similar abstraction before you actually start writing code?<p>I am planning on starting a new Django app after a few years out of &quot;the game&quot;. The last sites I worked on were Rails and Django projects deployed on Heroku back in about 2014, before Docker took off. Now in 2020, I have a sense that I &quot;should&quot; be using Docker or Kubernetes in my deployment scheme, but I&#x27;m not sure how much I should worry about containerization before I start writing code. I would like to get started on the codebase quickly, but I also don&#x27;t want to incur the technical debt of a containerization retrofit.<p>So, HN readers, when do you containerize a new project?
======
trcollinson
I am very good at containerizing and deploying projects. So I usually do that
part immediately because I have patterns for it and it takes less than an hour
to get started. This is how I start a new project:

1) I use Gitlab. So I make a quick gitlab-ci.yml and have a few steps. Test,
Build, and Deploy. Test might just run one fake test to start. Build might do
nothing much. Deploy might do nothing much at first.

2) Stick the project into a docker container. So create a simple Dockerfile.
Make sure I can run the app from within the Dockerfile. Make sure the
Dockerfile builds from Gitlab from the gitlab-ci.yml (which is the build
step).

3) Deploy the app to AWS. I like ECS but maybe it's a lambda and I deploy it
to Lambda. Just depends on what I am building. I update the gitlab-ci.yml to
do that (this is the deploy step).

4 - forever) Code and only update the gitlab-ci.yml when I need to.

Honestly, the whole thing really takes less than an hour and I never have to
worry about build and deploy after that. I say do it early. Also, don't over
complicate it. Especially if you are using Django.

~~~
jamesmaniscalco
Interesting, thanks. Do you recommend Gitlab over Github because of the built-
in CI/CD?

~~~
trcollinson
I happen to be a huge fan of Gitlab, and that is one of the reasons yes. I
don't think Github is bad by any means, but I like the Gitlab roadmap.

There are a number of really good CICD systems for Github. If you like Github,
pick it and go for it. Just get started and don't spend more than an hour
thinking about the whole thing. That's where the waste really comes in.
Spending all of that time thinking instead of just doing.

------
ashconnor
> So, HN readers, when do you containerize a new project?

When my Heroku bill becomes a concern.

If you choose Kubernetes then you will end up wasting time Yak Shaving that
could be spent writing your Django.

