3 ms·
I always thought that Docker made sense if the code or environment in which your code ran would be replicated onto many and different bits of hardware. In other
by nunez 9y ago
I always thought that Docker made sense if the code or environment in which your code ran would be replicated onto many and different bits of hardware. In other words, Docker makes sense for maximum portability. Without knowing more about your use case, this seems like bespoke, one-time work. Docker doesn't make sense for that.
I can see how you would have run into issues with Compose, as it creates multiple containers and links them instead of creating them individually. It doesn't display output by default, so you'll have to hit your logs if something went away.
Your order could have also been optimized and automated further:
1. Clone repo
2. Install Docker and Compose, preferably from a setup script
3. Fetch data set (though shouldn't this live somewhere remote?). Wait. This can be done with a container, btw
4. Have Compose bring up database container
5. Have Compose bring up API server
6. Run tests to verify all is operational
- rspeer 9y agoWhat do you mean by "shouldn't this live somewhere remote"? The input data is on S3 and/or Zenodo, but you need to download it and put it in PostgreSQL. You can't just give arbitrary people remote access to a PostgreSQL database. The rest of what you've described is pretty much the happy path of what I've already got, where one container has the DB and one has the API. There's a complication you're missing because you can't load data into the DB if you're not running the DB container, and also there is apparently no way to script Compose to start the API when the DB is ready. So actually you start the containers first, and the DB container spends a while loading the data and the API spends a few hours saying "I don't have data yet, sorry :(". So even the happy path has this step where you wait for five hours and hope things are working. But most people don't land on the happy path.