Last active
April 8, 2019 10:11
-
-
Save AidasK/732437c233e4e78849aa to your computer and use it in GitHub Desktop.
docker nginx-proxy installation guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=$(basename `pwd` | tr "[:upper:]" "[:lower:]") | |
CONTAINER="${DIR}""_php_1" | |
# support for whitespace in arg list | |
CSMOPTS=() | |
whitespace="[[:space:]]" | |
for i in "$@" | |
do | |
if [[ $i =~ $whitespace ]] | |
then | |
CSMOPTS+=("$i") | |
else | |
CSMOPTS+=($i) | |
fi | |
done | |
docker exec -ti -u www $CONTAINER php /var/www/artisan "${CSMOPTS[@]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add to executable path | |
DIR=$(basename `pwd` | tr "[:upper:]" "[:lower:]" | tr -cd '[[:alnum:]]') | |
CONTAINER="${DIR//-}""_$1_1" | |
docker exec -ti $CONTAINER sh -c 'TERM=xterm bash' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# default options for docker service /etc/default/docker | |
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -H tcp://0.0.0.0:2375" | |
# for systemctl | |
# sudo systemctl status docker | grep Loaded | |
# ExecStart=/usr/bin/docker -d --dns 8.8.8.8 --dns 8.8.4.4 -H tcp://0.0.0.0:2375 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy: | |
image: jwilder/nginx-proxy | |
ports: | |
- "80:80" | |
environment: | |
DOCKER_HOST: "tcp://172.17.42.1:2375" | |
volumes: | |
- "docker-nginx.conf:/etc/nginx/conf.d/my_proxy.conf" | |
# for macos https://github.com/jwilder/nginx-proxy/issues/280#issuecomment-153421303 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client_max_body_size 100m; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to your .profile .bashrc .zshrc | |
export DOCKER_HOST=tcp://127.0.0.1:2375 | |
alias dc=docker-compose | |
#eval "$(docker-machine env default)" for macos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment