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/):
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.