Skip to main content

Docker Deploy


Init

base_path=/data
openresty_image=openresty/openresty:1.27.1.2-bookworm
mkdir -p $base_path/openresty/logs
mkdir -p $base_path/openresty/conf

Pull Image

docker pull $openresty_image

nginx.conf

docker run --rm $openresty_image \
  cat /usr/local/openresty/nginx/conf/nginx.conf \
  > $base_path/openresty/conf/nginx.conf

docker-run.sh

docker run -d \
  --name openresty \
  -p 80:80 \
  -p 443:443 \
  -v $base_path/openresty/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf \
  -v $base_path/openresty/conf/conf.d:/usr/local/openresty/nginx/conf/conf.d \
  -v $base_path/openresty/logs:/usr/local/openresty/nginx/logs \
  $openresty_image