Live data from Hacker News

Awesome Docker Compose Examples

github.com

31–40 of 85 posts

Re: Awesome Docker Compose Examples

#31

Earlier quoted context omitted.

In my README I explain how to setup the Docker context over SSH. In my system all of the files get written to the volume from only three places: * From the docker image through VOLUME (fresh volumes copy the data from the image on start) * From a template container that writes config files. * From the container itself, writing files as it runs. What I don't do is create a directory someplace and manually edit files a…

What if the docker daemon is on a storage server and the host volume of /stuff contains, say, 10 terabytes of photo album content? > If you tell me to run > > docker run -v ${HOME}/stuff:/stuff alpine > > It will mount /home/stuff on the server, not my own > home directory on my laptop. That seems about right? And then you note: > What I don't do is create a directory someplace and manually edit files and mount them.…

> Looking at your repo, I see your docker-compose volumes map e.g. data to data … volumes: - data:/data

Theres two ways to mount a volume, one with a / and one without.

/some/directory:data

some-volume:data

The first mounts a directory

The second mounts a named volume.

I suggest doing the second so that it can be maintained directly by docker through `docker volume create|rm` or `docker compose up|down [-v]`.

Re: Awesome Docker Compose Examples

#32
post #26

Nice examples. I personally really love compose. For all the complexity in the container space it really nails down a fanatic experience.

> I personally really love compose. For all the complexity in the container space it really nails down a fanatic experience.

Fanatics love docker, for sure. It's… fantastic!

Re: Awesome Docker Compose Examples

#33

Earlier quoted context omitted.

In my README I explain how to setup the Docker context over SSH. In my system all of the files get written to the volume from only three places: * From the docker image through VOLUME (fresh volumes copy the data from the image on start) * From a template container that writes config files. * From the container itself, writing files as it runs. What I don't do is create a directory someplace and manually edit files a…

What if the docker daemon is on a storage server and the host volume of /stuff contains, say, 10 terabytes of photo album content? > If you tell me to run > > docker run -v ${HOME}/stuff:/stuff alpine > > It will mount /home/stuff on the server, not my own > home directory on my laptop. That seems about right? And then you note: > What I don't do is create a directory someplace and manually edit files and mount them.…

Replying in series as I see more of your edits:

> For instance, mounting a volume that can be edited by other containers lets me insta-move large files or sets of files between steps of containers,

As long as the containers are on the same docker host, many containers can mount the same volume.

Re: Awesome Docker Compose Examples

#34

Earlier quoted context omitted.

These are excellent, thank you. I maintain similar Django and Flask + compose stacks on behalf of the startup studio I work for so it’s fun to compare notes. For our Django stack, for instance, we have also settled on Postgres, on celery+redis, and on whitenoise. black/flake8/isort also seem universally agreeable. We also throw in pyright and generally make extensive use of type hints. For the front-end, we’re curren…

no offense, but man, the amount of tooling you guys are using sounds to me insane. How is a person able to oversee and understand everything. The older i get the more i feel distantiated and disconnected to these modern practices. I am afraid that if I ever have to find a new workspace i wont be able to succeed because of this.

I'm so-called full stack developer so I have to be on top of it and it's hard. I'm constantly behind so I spend quite a lot of time catching up whenever I'm getting chance. It's possible (e.g. I think that I can one-handed build an application with react frontend and java/golang/node backend, build a k8s cluster and deploy everything, following best practices), but it's lot of things that you'll forget eventually.

I think that one sane way is specialization. Become an expert in writing nginx-ingress yamls in some big corporation. Another sane way is to throw away modern tech and stay with old tech. You can deploy perl cgi to OpenBSD just like you could 20 years away. Another way is to carefully select technologies which were proven for 7+ years. I'm trying to follow this way.

Re: Awesome Docker Compose Examples

#35
post #6

There's a lot of "tool" selections in that repo. If anyone is looking for ready to go web app examples aimed at both development and production with Docker Compose, I maintain: - https://github.com/nickjj/docker-flask-example - https://github.com/nickjj/docker-rails-example - https://github.com/nickjj/docker-django-example - https://github.com/nickjj/docker-node-example - https://github.com/nickjj/docker-phoenix-exam…

Taking a quick look and nothing I saw manages ssl - do you even package that or do you have that as entirely different steps?

Re: Awesome Docker Compose Examples

#36

Nice collection, although I don't really like binding volumes to host directories, because then you can't really use docker over SSH. I'm working on my own similar project here that exclusively uses docker named volumes: https://github.com/enigmaCurry/d.rymcg.tech

But names volumes kind of make backups harder + you will need bind mount for external config files anyway.

Re: Awesome Docker Compose Examples

#37

Earlier quoted context omitted.

These are excellent, thank you. I maintain similar Django and Flask + compose stacks on behalf of the startup studio I work for so it’s fun to compare notes. For our Django stack, for instance, we have also settled on Postgres, on celery+redis, and on whitenoise. black/flake8/isort also seem universally agreeable. We also throw in pyright and generally make extensive use of type hints. For the front-end, we’re curren…

no offense, but man, the amount of tooling you guys are using sounds to me insane. How is a person able to oversee and understand everything. The older i get the more i feel distantiated and disconnected to these modern practices. I am afraid that if I ever have to find a new workspace i wont be able to succeed because of this.

No offense but that list of tools is miniscule and you should pause if you think it's anywhere near "insane". For comparison a regular handyman with a basic set of tools easily has 50+ if they just started. It's definitely possible to understand all of that and way more. Unless you're fresh out of uni and never worked on a professional company with more than a couple of people you'd see many more.

Re: Awesome Docker Compose Examples

#38

Nice collection, although I don't really like binding volumes to host directories, because then you can't really use docker over SSH. I'm working on my own similar project here that exclusively uses docker named volumes: https://github.com/enigmaCurry/d.rymcg.tech

But names volumes kind of make backups harder + you will need bind mount for external config files anyway.

> kind of make backups harder

How so? For me it makes it easier, just have to backup one directory: /var/lib/docker/volumes

> you will need bind mount for external config files anyway

I create all my config files from templates, generated by a container, with the config entirely driven by environment variables, and this runs before my main container (via `depends_on`) it writes the config to a named volume. So there are no "external" config files, only "internal" ones.

Re: Awesome Docker Compose Examples

#39
post #37

Earlier quoted context omitted.

no offense, but man, the amount of tooling you guys are using sounds to me insane. How is a person able to oversee and understand everything. The older i get the more i feel distantiated and disconnected to these modern practices. I am afraid that if I ever have to find a new workspace i wont be able to succeed because of this.

No offense but that list of tools is miniscule and you should pause if you think it's anywhere near "insane". For comparison a regular handyman with a basic set of tools easily has 50+ if they just started. It's definitely possible to understand all of that and way more. Unless you're fresh out of uni and never worked on a professional company with more than a couple of people you'd see many more.

[deleted]
Post reply on HN