I'm incredible confused between Docker Hub, Cloud, Swarm, Swarm Mode, docker deploy, docker-compose Deploy, ...
What is the simplest docker deployment practice for a production website that fits comfortably within the capabilities of a single physical server?
The site in question has a comprehensive docker-compose.yml that starts up some 12 services covering various web servers, webpack builders and DB. An environment variable is used to control for dev or production.
A command-line tool is used to upload Webpack bundles to S3 bucket, and sourcemaps to Sentry. The bundle hash is used as a release ID, which is stored in an environment variable (i.e. HTML is written with <script src="https://s3.site.com/c578f7cbbf76c117ca56/bundle.js">
where the hash c57...
is written into the environment variable file pointed to by each service in docker-compose.yml
).
I don't need more than one server, nor comprehensive failover strategies. I just want to avoid downtime when deploying code updates. I'm a single developer so I don't need CI or CD.
I understand docker-machine is deprecated. Docker Hub deals with images individually, so I understand I need something that deals with the concept of a "stack", or a set of related services. I understand that Docker Cloud's stack.yml files don't support build
or env_file
keys, so my docker-compose.yml is not directly usable
(In my docker-compose.yml
I have many occurrences of the following pattern:
build:
context: .
dockerfile: platforms/frontend/server/Dockerfile
and in the Dockerfile, for example:
COPY platforms/frontend/server /app/platforms/frontend/server
Without the separation of build context and Dockerfile location, the compose file doesn't seem to translate to stack file).
Furthermore, I think that Docker Cloud / Swarm are for managing multiple fail-over servers and round-robin routing and so on? I don't think I need any of this.
Finally I started to realise docker-compose deploy
exists... is this the tool/strategy I'm after?