Document nginx vserver setup
This commit is contained in:
@@ -26,6 +26,7 @@ REMOTE_APP_DIR="${REMOTE_APP_DIR:-/opt/rolemasterdb}"
|
||||
REMOTE_DATA_DIR="${REMOTE_DATA_DIR:-$REMOTE_APP_DIR/data}"
|
||||
IMAGE_NAME="${IMAGE_NAME:-rolemasterdb}"
|
||||
CONTAINER_NAME="${CONTAINER_NAME:-rolemasterdb}"
|
||||
HOST_BIND_ADDRESS="${HOST_BIND_ADDRESS:-}"
|
||||
HOST_PORT="${HOST_PORT:-8080}"
|
||||
CONTAINER_PORT="${CONTAINER_PORT:-8080}"
|
||||
REMOTE_USE_SUDO="${REMOTE_USE_SUDO:-0}"
|
||||
@@ -89,6 +90,7 @@ ssh "$REMOTE_HOST" bash -s -- \
|
||||
"$REMOTE_DATA_DIR" \
|
||||
"$IMAGE_NAME" \
|
||||
"$CONTAINER_NAME" \
|
||||
"$HOST_BIND_ADDRESS" \
|
||||
"$HOST_PORT" \
|
||||
"$CONTAINER_PORT" \
|
||||
"$REMOTE_USE_SUDO" \
|
||||
@@ -100,10 +102,11 @@ remote_app_dir="$2"
|
||||
remote_data_dir="$3"
|
||||
image_name="$4"
|
||||
container_name="$5"
|
||||
host_port="$6"
|
||||
container_port="$7"
|
||||
remote_use_sudo="$8"
|
||||
remote_env_file="$9"
|
||||
host_bind_address="$6"
|
||||
host_port="$7"
|
||||
container_port="$8"
|
||||
remote_use_sudo="$9"
|
||||
remote_env_file="${10}"
|
||||
|
||||
release_dir="$remote_app_dir/releases/$release_id"
|
||||
tarball_path="$release_dir/release.tar.gz"
|
||||
@@ -132,13 +135,18 @@ docker_run_args=(
|
||||
-d
|
||||
--name "$container_name"
|
||||
--restart unless-stopped
|
||||
-p "$host_port:$container_port"
|
||||
-e "ASPNETCORE_ENVIRONMENT=Production"
|
||||
-e "ASPNETCORE_URLS=http://+:$container_port"
|
||||
-e "ConnectionStrings__RolemasterDb=Data Source=/app/data/rolemaster.db"
|
||||
-v "$remote_data_dir:/app/data"
|
||||
)
|
||||
|
||||
if [[ -n "$host_bind_address" ]]; then
|
||||
docker_run_args+=(-p "$host_bind_address:$host_port:$container_port")
|
||||
else
|
||||
docker_run_args+=(-p "$host_port:$container_port")
|
||||
fi
|
||||
|
||||
if [[ -n "$remote_env_file" ]]; then
|
||||
docker_run_args+=(--env-file "$remote_env_file")
|
||||
fi
|
||||
@@ -152,7 +160,11 @@ ln -sfn "$release_dir" "$remote_app_dir/current"
|
||||
echo "Deployment complete."
|
||||
echo "Release: $release_id"
|
||||
echo "Container: $container_name"
|
||||
echo "Host port: $host_port"
|
||||
if [[ -n "$host_bind_address" ]]; then
|
||||
echo "Published at: $host_bind_address:$host_port -> $container_port"
|
||||
else
|
||||
echo "Published at: $host_port -> $container_port"
|
||||
fi
|
||||
EOF
|
||||
|
||||
echo "Local bundle ready at $tarball_path"
|
||||
|
||||
Reference in New Issue
Block a user