Skip to content

Commit

Permalink
Adds a 1g memory limit on docker server
Browse files Browse the repository at this point in the history
Also provides a way to send extra arguments to the docker command when
starting the server
  • Loading branch information
thostetler committed Mar 16, 2021
1 parent f41f38b commit e6c154b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ fi

home=`pwd`
target=${1:-src} # workdir that will become webserver's root
extraargs=${2:- -m=1g}

# add extra args (to docker) like this:
# ./server.sh src '-m=1g --memory-swap=1g ...'

docker rm -f bbb-nginx 2>/dev/null
docker run -p 8000:80 -v $home/$target/:/app/production -v $home/nginx.conf:/etc/nginx/nginx.conf bbb-nginx nginx
docker run -p 8000:80 -v $home/$target/:/app/production -v $home/nginx.conf:/etc/nginx/nginx.conf $extraargs bbb-nginx nginx

0 comments on commit e6c154b

Please sign in to comment.