Commit 5674bde4 authored by Aral Balkan's avatar Aral Balkan
Browse files

Updated deployment documentation.

parent 1dc70098
......@@ -4,29 +4,36 @@
Deploying to a 160GB droplet on Digital Ocean with backups turned on. IPv4. In Amsterdam zone 3.
Using Dokku.
Using Dokku (see `home/dokku/` on server.)
## Troubleshooting
## Dokku
Errors I got while deploying and the solutions:
When the app is deployed, it is in a Docker container.
### 413 Request Entity Too Large
### Entering the docker instance
nginx configuration error.
We need to use [nsenter](https://github.com/jpetazzo/nsenter)[instructions](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/):
[Info](http://www.daveperrett.com/articles/2009/11/18/nginx-error-413-request-entity-too-large/)
1. `docker ps -a` to get the container id.
2. `PID=$(docker inspect --format {{.State.Pid}} <container_name_or_ID>)`
3. nsenter --target $PID --mount --uts --ipc --net --pid
Fix:
Once in the docker instance, you can find the app at `/app`
server {
client_max_body_size 75M;
}
## Locations
Videos are uploaded to /home/videos on the server.
We use `dokku-persistent-storage` plugin to map that location to the /public/videos folder in the app’s container.
However, this requires the nginx.conf to be altered. Which would mean that it is overwritten in the next deploy. No go. So we need…
## Plugins
## dokku-nginx-vhosts-custom-configuration plugin
### Use case
To alter nginx.conf after deployment (we can’t edit nginx.conf on server as it will be overwritten at next deploy.)
The [Dokku nginx vhosts custom configuration plugin](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) lets you add custom settings to your nginx.conf after you deploy. Nice.
### Install
......@@ -41,3 +48,47 @@ Create a file calle `nginx.inc.conf` in the app and commit it. Then, on the serv
Remember that the app name is the full domain of the app you used when deploying (e.g., for us its `iam.ind.ie`).
## dokku-persistent-storage
### Use case
To set the file upload folder so that it is not overwritten on deployment.
* [Site](https://github.com/dyson/dokku-persistent-storage)
* [Article](http://millionknow.biz/zervas/2014/09/25/how-to-set-volume-for-dokku-persistent-storage/)
### Install
git clone https://github.com/dyson/dokku-persistent-storage.git /var/lib/dokku/plugins/persistent-storage
### Usage
In the application folder (/home/dokku/iam.ind.ie) create a file called `PERSISTENT_STORAGE`.
**Contents:**
# Map the public/videos folder in the app (where uploaded videos are kept)
# to the /home/videos folder on the server so that the uploads are not overwritten.
/home/videos:/app/public/videos
## Troubleshooting
Errors I got while deploying and the solutions:
### 413 Request Entity Too Large
nginx configuration error.
[Info](http://www.daveperrett.com/articles/2009/11/18/nginx-error-413-request-entity-too-large/)
Fix:
server {
client_max_body_size 75M;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment