Skip to content

Commit

Permalink
Adds nginx-proxy config file to support large file uploads (#26)
Browse files Browse the repository at this point in the history
* Allow uploads bigger than 1M - also lets projects customise their nginx config.

* Volumes must be full path, not relative. Nicer comment.

* Break up connect the web container to the nginx-proxy. Start nginx-proxy first to allow running setup command from the scaffold.

* Doh, wrong brackets. Exec, not variable.
  • Loading branch information
pingers authored Apr 5, 2018
1 parent 2d10e23 commit 18e3440
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dsh
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ setup() {
fi
setup_ssh_agent_proxy
fi
setup_docker_network
setup_nginx_proxy
setup_docker_network
setup_nginx_connect
}

setup_docker_machine() {
Expand Down Expand Up @@ -231,16 +232,20 @@ setup_nginx_proxy() {
if docker ps -a | grep "nginx-proxy" > /dev/null; then
docker start nginx-proxy > /dev/null
else
# Configuration is only applied when the container is created.
docker run -d -p 80:80 \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-v /etc/nginx/conf.d/dsh_proxy.conf:$(pwd)/dsh_proxy.conf \
--restart always --name nginx-proxy \
jwilder/nginx-proxy
fi

if ! docker ps | grep "nginx-proxy" > /dev/null; then
error "jwilder/nginx-proxy could not be started."
fi
}

setup_nginx_connect() {
set +e
# Test to make sure its not already on the network.
if ! docker network inspect ${PROJECT}_default | grep "nginx-proxy" > /dev/null; then
Expand Down
1 change: 1 addition & 0 deletions dsh_proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client_max_body_size 100m;
1 change: 1 addition & 0 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function updateShepherdScaffoldFiles()
$projectPath,
[
'docker-compose.yml',
'dsh_proxy.conf',
'RoboFile.php',
]
);
Expand Down

0 comments on commit 18e3440

Please sign in to comment.