Docker Hub ?? Nginx ??? ??
https://hub.docker.com/_/nginx/
??? ?? ??? ??? ????.
?? ???:
????nginx ???? ?? ?? ??
????? Nginx? ???? ?? ?? ??? ?? ?? ??? ???? ????. ???
envsubst
nginx? ???? ?? ???? nginx ??? ???? ?? ?? ?? ???? ??? ? ????.??? docker-compose.yml? ???? ????.
mysite.template ???? ??? ?? ?? ??? ??? ? ????.
${NGINX_PORT} ??
??:
?? ??? ??? ?, ? command:
???
1? envsubst
? ??? ??????
2. daemon off;
? ??? ??????
3. command:
?? ??? ??? ?????? ?? ??? ?? ??????
學(xué)習(xí)是最好的投資!
envsubst? ??? ?? ??? ???? ? ????? ????. ??? ??? ?? ??? ?????
daemon off: nginx? ????? ??????? ???? ??? ?????.
command? docker run nginx /bin/sh
?? ??? ?? nginx ?? /bin/sh ???? ?? ???? ??? ? ????. .
?? ?? ??? ? ???
/bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf
?? ?? ??
nginx - g 'daemon off;'" ?? ??
??: ????? ??? ? ??? ??? docker run ?? ???? ???? ? ????.