docker_compose_deploy 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -2
- data/lib/docker_compose_deploy/cli.rb +1 -1
- data/lib/docker_compose_deploy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a774694b30eb0776bd8680e03ddb32587568420a
|
4
|
+
data.tar.gz: 2c59b4d8628a72430f1f87eb547fc3d30ba111e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dda2d468c2d77d01e5c8e9c8ebdff23327e58709cc84bcbafcc9b44d7b6f9577c549f46c529c903a08d6d5bb08c6e5048fcb1061f37624b2c896ac642e5d3af3
|
7
|
+
data.tar.gz: 36f940feea352bba112f9b2421f38d2f593731bd7bacde7f199d6aab6e2ded846e0a99ff4d4e4f1b28d9335afa1c4f032270ba27604b225fdbbc3375f4c0740e
|
data/README.md
CHANGED
@@ -6,12 +6,27 @@ This gem is a collection of scripts that I use to deploy my personal websites us
|
|
6
6
|
- Provision a server with Docker and Docker Compose
|
7
7
|
- Test your deployment on a vagrant machine
|
8
8
|
- Deploy your docker-compose project
|
9
|
-
- Backup the data that your applications
|
9
|
+
- Backup the data that your applications generate
|
10
10
|
|
11
11
|
While these scripts are great for your personal projects, they will not help you with zero-downtime deploys, rotating your logs, or any of that other fancy stuff.
|
12
12
|
|
13
13
|
This doesn't provide much over using docker-machine, but it will simplify working with volumes and allow you to test your deployment in a realistic environment.
|
14
14
|
|
15
|
+
### Commands
|
16
|
+
|
17
|
+
Each command takes an optional `-e [environment]`. If the environment is not set, it will default to `test`. This environment corresponds to the entry in `config.yml`. There you can configure the connection string for sshing to the host. By default the `test` environment is set up to connect to the vagrant host configured in the Vagrantfile.
|
18
|
+
|
19
|
+
`dcd new [project_name]`: Scaffold a new project.
|
20
|
+
|
21
|
+
`dcd provision`: Install Docker & DockerCompose on the host machine.
|
22
|
+
|
23
|
+
`dcd deploy`: Push your `docker-compose.yml` to the host machine, create directories for volume-mapping (explained below), pull the required docker images, and run `docker-compose up`.
|
24
|
+
|
25
|
+
`dcd backup`: Tar, bzip, and download the `./sites/data` for safekeeping.
|
26
|
+
|
27
|
+
`dcd push [image_names]`: __If all of your images are on hub.docker.com, then you don't need this command.__ Normally you might push your docker images to http://hub.docker.com. However, you might have some images that you'd prefer to keep private. This command will take a local image, tar it, push it to the remote host. Using `dcd push` you do not need to push your private image to docker hub. This is significantly slower than using the registry because you need to push the entire image each time. Note that if you use this command, you will need to set `ignore_pull_failures: true` in your `config.yml`.
|
28
|
+
|
29
|
+
|
15
30
|
### The big picture
|
16
31
|
|
17
32
|
For my homepage, I serve up multiple applications from the same machine. For this reason, I have nginx to inspect incoming requests and route them to the correct application. As I add new applications, I need to change this setup. So I need to push a new nginx config file as part of my deployment process.
|
@@ -87,12 +102,14 @@ Each site that is deployed with `dcd` will be provided three directories to moun
|
|
87
102
|
|
88
103
|
- `./sites/[app_name]/config`: This directory is pushed from your localhost to the remote. Each time you run `dcd deploy` the config directory for each application will be __removed and replaced__ by the directory found on your localhost (if any). Notice that there is a file on your localhost at `./sites/proxy/config/nginx.conf`. This file will be copied to your host at deployment time.
|
89
104
|
|
90
|
-
- `./sites/[app_name]/data`: This directory is the permanent storage for your application. When running `dcd backup`, each application's `data` directory will be zipped up and downloaded for safekeeping.
|
105
|
+
- `./sites/[app_name]/data`: This directory is the permanent storage for your application. This directory will be created by `dcd` but it will not be changed or removed by `dcd. When running `dcd backup`, each application's `data` directory will be zipped up and downloaded for safekeeping.
|
91
106
|
|
92
107
|
- `./sites/[app_name]/log`: This directory is for storing logs. It is never removed, but it is also not included in backups. To see what's inside, you'll have to ssh to your server.
|
93
108
|
|
94
109
|
Although none of the sites in the skeleton make use of their data directories, the volume maps are included to indicate what mounts are available. Understanding how nginx is configured is beyond the scope of this project, but the configuration found at `./sites/proxy/config/nginx.conf` should be a good template to follow.
|
95
110
|
|
111
|
+
Once you've deployed the initial skeleton to the vagrant host, ssh to it (`vagrant ssh`) and look around the `~/sites` folder to see all the folders its created.
|
112
|
+
|
96
113
|
---
|
97
114
|
|
98
115
|
__config.yml__
|
@@ -146,6 +163,9 @@ vagrant ssh-config >> ssh_config_overrides
|
|
146
163
|
|
147
164
|
This will update the ssh connection info to work with your vagrant machine.
|
148
165
|
|
166
|
+
### Deploying to DigitalOcean
|
167
|
+
|
168
|
+
I use a cheap vps on http://wwww.digitalocean.com to host my site. Create a droplet and copy its ip address. Update `config.yml` with `root@[ip-address]` as the `production` connection string. Then run `dcd provision && dcd deploy`. Now configure your dns and you should be done!
|
149
169
|
|
150
170
|
### Issues/Questions
|
151
171
|
|
@@ -41,7 +41,7 @@ module DockerComposeDeploy
|
|
41
41
|
Actions::Server.new(Util::Shell.new).provision
|
42
42
|
end
|
43
43
|
|
44
|
-
desc "new", "create a new docker-compose server skeleton"
|
44
|
+
desc "new PROJECT_NAME", "create a new docker-compose server skeleton"
|
45
45
|
def new(name)
|
46
46
|
Actions::Skeleton.new(name, Util::Shell.new).create
|
47
47
|
end
|