geerlingguy / docker-examples Goto Github PK
View Code? Open in Web Editor NEWThere are many like it, but this one is mine.
License: MIT License
There are many like it, but this one is mine.
License: MIT License
Saw the repo and am interested in where you take this. Docker is really neat We met at Drupalcon at the sprints if you remember at all and had a short conversation on it.
I'd recommend taking a look at http://container42.com/2014/11/18/data-only-container-madness/
Pretty much it's just a waste of data since you can use a container you already have for it
There's "running an Nginx webserver on localhost" followed by this command line: docker run -d -p 80:80 --name webserver nginx
But in reality, you need to use docker run -p 127.0.0.1:nnnn:nnnn to use localhost. And Docker will go out of its way to even make a firewall rule to allow traffic to the given incoming port from the internet.
I was curious why your nginx+php-fpm example uses a separate 'data' container based on busybox to provide the volumes. When I run the example via docker-compose the data container exits immediately, but the volumes work fine between nginx and the php-fpm container of course. This isn't a pattern I've seen documented before, is there a particular reason for the third tiny container ?
There are some interesting solutions to the problem of "how do I use friendly domain names that can be automatically/easily configured" with Docker containers. Some important background:
In this example, I'd like to highlight customizing base images using Dockerfiles, especially installing extra packages (the right way) and adding a HEALTHCHECK
.
See the canonical thread, File access in mounted volumes extremely slow, CPU bound, as well as its continuation on GitHub: File access in mounted volumes extremely slow. Basically, performance on the Mac (haven't tested other environments) is abysmal for apps that require reading/writing of many or large files. Here are some interim solutions until osxfs
is up to snuff:
Something more real-worldish, and more Dockerish, than examples I've seen so far (e.g. no mega-container with Apache+PHP+Composer+everything-under-the-sun inside).
If you're going to use Docker, don't jam in all the bad things about legacy deployment into one massive 1.2+ GB container!
Also, if there's any easy way to work on simple configurability (á la Drupal VM to make something like a 'Drupal VM lite', I'd like to explore it. So far most of the good Docker Drupal examples I've seen are a pain to customize/adapt, while most of the flexible Docker Drupal examples I've seen are slow, bloated, messy, and offer very little benefit over using plain old VMs.
Symfony is a PHP framework for web projects.
I'd like to add an example that builds a generic 'hello-world' Symfony app and connects to SQLite in a separate container.
One interesting aspect (and one about which I wrestle with in the 'this-isn't-something-for-prod-therefore-why-is-it-done-in-acontainer' way) is the idea of doing Composer work inside Docker.
IMO, it would be better to do all the app build process in a separate pipeline, then run the app in Docker containers. Technically the build process could be managed in some Docker containers... but you should always run your app in the exact same way as Production. And Production should not have Composer, nor should it be involved in your build process (especially since that saps up resources!).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.