I don't think I agree with this. Docker is an amazing tool, I've used it for everything I've done in the last 7 years, but this is not how I'd approach it. 1. I think the idea of local-equal-to-prod is noble, and getting them as close as possible should be the goal, but is not possible. In the example, they're using a dockerized postgres, prod is probably a managed DB service. They're using docker compose, prod is li…
Developing with Docker
51–60 of 66 posts
Re: Developing with Docker
#52I have experimented with a local setup in our team. With the new Docker compose watch functionality I think it works well. https://docs.docker.com/compose/how-tos/file-watch/ For me this has negated the need for manual mounting. I combine the above with dotnet watch —-non-interactive in the dockerfile for dotnet and a simple ng serve in our Angular apps. If new dependencies are added via npm install you can set it so…
> This negates the need for manual mounting. The documentation you linked says it is a complement not a replacement. > Compose supports sharing a host directory inside service containers. Watch mode does not replace this functionality but exists as a companion specifically suited to developing in containers.
Re: Developing with Docker
#53I don't think I agree with this. Docker is an amazing tool, I've used it for everything I've done in the last 7 years, but this is not how I'd approach it. 1. I think the idea of local-equal-to-prod is noble, and getting them as close as possible should be the goal, but is not possible. In the example, they're using a dockerized postgres, prod is probably a managed DB service. They're using docker compose, prod is li…
> I don't want to be negative, but if one of my engineers came to me saying they wanted to deploy images built from their machine, with all the dev niceties enabled, to go to prod, rather than proper CI/CD of prod optimized images, I'd have a hard time being sold on that. ditto, "worked on local" is a meme for a reason.
Re: Developing with Docker
#54I love Docker (more so the idea of containers). Use it almost everywhere: self hosting services, at work everything is deployed as a docker container. Except local development. Absolutely hate the "oh need to add a dependency, gotta rebuild everything" flow. I do use it if the project I'm developing against needs a DB/redis/etc, but I don't think there's a chance I'm going back to using it for local development. In f…
I hate container and Docker in ANY use-case where there is an alternative that is same, or even "a little bit" more involved. I reserve Docker and Containers for that use case where I really would have headaches if it is no there, and have not still found such a case in all the works I've done.
Re: Developing with Docker
#55For instance: Docker is great for local development that never touches prod.
Docker is great for hybrid local dev, where you run some services in docker but not others.
If your desktop is Linux and you are building python based web services, then running python in a virtualenv is often much more responsive than having to rebuild some docker thing.
Re: Developing with Docker
#56This demonstrates the most pernicious thing about Docker: it is now easier than ever for someone to design a Rube Goldberg machine and then neatly sweep it under the rug. When you see the dev environment setup described, the knee jerk reaction should be to simplify it, not to automate the running of 30 disparate commands. Then you can much more easily run it in production, instead of boxing up the mess and waiting un…
Re: Developing with Docker
#57It sounds good, but Docker is also good for all sorts of other patterns too. For instance: Docker is great for local development that never touches prod. Docker is great for hybrid local dev, where you run some services in docker but not others. If your desktop is Linux and you are building python based web services, then running python in a virtualenv is often much more responsive than having to rebuild some docker…
Re: Developing with Docker
#58Earlier quoted context omitted.
You can inject keys into the running container by passing them as environment variables during the docker run command, ideally supplied via a secrets manager.
You can also pass an entire .env file with the --env-file option.
Keeping a .env file around still is still a vulnerability if a device goes missing.
Re: Developing with Docker
#59> At it's simplest, stuff like this: if ENVIRONMENT == "prod": do_something_only_production_does() ...shouldn't happen. This is a common refrain among people that IMO do not have a lot of experience in big, complex systems, especially ones running a lot of legacy code. Like, ideally, sure, but in reality making this possible almost always involves extra cost, time, and complexity, and what do you gain from that, real…
Re: Developing with Docker
#60It's a breath of fresh air not having to maintain a separate local environment.