vps setup
This commit is contained in:
@@ -115,8 +115,8 @@ Create 2 files `admin_api_url` and `admin_base_path` with URL and secret path in
|
|||||||
**When you need to source it:** Only for one-off manual `docker compose` runs (e.g. first-time start in §2.6, or starting phpMyAdmin in §4.1). You do **not** need to source it for deployment: `scripts/rolling-update.sh` loads the password from the secret file automatically when `DB_ROOT_PASSWORD` is not set.
|
**When you need to source it:** Only for one-off manual `docker compose` runs (e.g. first-time start in §2.6, or starting phpMyAdmin in §4.1). You do **not** need to source it for deployment: `scripts/rolling-update.sh` loads the password from the secret file automatically when `DB_ROOT_PASSWORD` is not set.
|
||||||
|
|
||||||
**IMPORTANT**
|
**IMPORTANT**
|
||||||
`Change Java memory in docker-compose.prod.yml when you know the PROD VPS characteristics.`
|
- `Change Java memory in docker-compose.prod.yml when you know the PROD VPS characteristics.`
|
||||||
|
- `Change the rolling-update.sh script to match sites-enabled nginx file name for PROD when you know the domain`
|
||||||
### 2.4 Logging (logback) and config dir
|
### 2.4 Logging (logback) and config dir
|
||||||
|
|
||||||
Backend uses an external **logback** config so you can change log level without rebuilding. Create the config dir and put `logback-spring.xml` there:
|
Backend uses an external **logback** config so you can change log level without rebuilding. Create the config dir and put `logback-spring.xml` there:
|
||||||
|
|||||||
@@ -44,39 +44,39 @@ COMPOSE_FILE="${PROJECT_DIR}/docker-compose.prod.yml"
|
|||||||
# Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths
|
# Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths
|
||||||
NGINX_CONF="${NGINX_CONF:-}"
|
NGINX_CONF="${NGINX_CONF:-}"
|
||||||
if [ -z "$NGINX_CONF" ]; then
|
if [ -z "$NGINX_CONF" ]; then
|
||||||
if [ -f "/etc/nginx/sites-enabled/honey.live" ]; then
|
if [ -f "/etc/nginx/sites-enabled/testforapp.website" ]; then
|
||||||
NGINX_CONF="/etc/nginx/sites-enabled/honey.live"
|
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website"
|
||||||
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
||||||
elif [ -f "/etc/nginx/sites-enabled/honey.live.conf" ]; then
|
elif [ -f "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
|
||||||
NGINX_CONF="/etc/nginx/sites-enabled/honey.live.conf"
|
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website.conf"
|
||||||
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
||||||
elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then
|
elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then
|
||||||
NGINX_CONF="/etc/nginx/conf.d/honey.conf"
|
NGINX_CONF="/etc/nginx/conf.d/honey.conf"
|
||||||
log "Using Nginx config: $NGINX_CONF (conf.d)"
|
log "Using Nginx config: $NGINX_CONF (conf.d)"
|
||||||
elif [ -f "/opt/app/nginx/honey.live.conf" ]; then
|
elif [ -f "/opt/app/nginx/testforapp.website.conf" ]; then
|
||||||
warn "Found config at /opt/app/nginx/honey.live.conf"
|
warn "Found config at /opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..."
|
warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..."
|
||||||
if [ -L "/etc/nginx/sites-enabled/honey.live" ] || [ -L "/etc/nginx/sites-enabled/honey.live.conf" ]; then
|
if [ -L "/etc/nginx/sites-enabled/testforapp.website" ] || [ -L "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
|
||||||
# Find the actual target
|
# Find the actual target
|
||||||
local target=$(readlink -f /etc/nginx/sites-enabled/honey.live 2>/dev/null || readlink -f /etc/nginx/sites-enabled/honey.live.conf 2>/dev/null)
|
local target=$(readlink -f /etc/nginx/sites-enabled/testforapp.website 2>/dev/null || readlink -f /etc/nginx/sites-enabled/testforapp.website.conf 2>/dev/null)
|
||||||
if [ -n "$target" ]; then
|
if [ -n "$target" ]; then
|
||||||
NGINX_CONF="$target"
|
NGINX_CONF="$target"
|
||||||
log "Using Nginx config: $NGINX_CONF (symlink target)"
|
log "Using Nginx config: $NGINX_CONF (symlink target)"
|
||||||
else
|
else
|
||||||
NGINX_CONF="/opt/app/nginx/honey.live.conf"
|
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
NGINX_CONF="/opt/app/nginx/honey.live.conf"
|
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
error "Cannot find Nginx config file."
|
error "Cannot find Nginx config file."
|
||||||
error "Searched:"
|
error "Searched:"
|
||||||
error " - /etc/nginx/sites-enabled/honey.live"
|
error " - /etc/nginx/sites-enabled/testforapp.website"
|
||||||
error " - /etc/nginx/sites-enabled/honey.live.conf"
|
error " - /etc/nginx/sites-enabled/testforapp.website.conf"
|
||||||
error " - /etc/nginx/conf.d/honey.conf"
|
error " - /etc/nginx/conf.d/honey.conf"
|
||||||
error " - /opt/app/nginx/honey.live.conf"
|
error " - /opt/app/nginx/testforapp.website.conf"
|
||||||
error ""
|
error ""
|
||||||
error "Please set NGINX_CONF environment variable with the correct path."
|
error "Please set NGINX_CONF environment variable with the correct path."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -44,39 +44,39 @@ COMPOSE_FILE="${PROJECT_DIR}/docker-compose.staged.yml"
|
|||||||
# Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths
|
# Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths
|
||||||
NGINX_CONF="${NGINX_CONF:-}"
|
NGINX_CONF="${NGINX_CONF:-}"
|
||||||
if [ -z "$NGINX_CONF" ]; then
|
if [ -z "$NGINX_CONF" ]; then
|
||||||
if [ -f "/etc/nginx/sites-enabled/honey.live" ]; then
|
if [ -f "/etc/nginx/sites-enabled/testforapp.website" ]; then
|
||||||
NGINX_CONF="/etc/nginx/sites-enabled/honey.live"
|
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website"
|
||||||
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
||||||
elif [ -f "/etc/nginx/sites-enabled/honey.live.conf" ]; then
|
elif [ -f "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
|
||||||
NGINX_CONF="/etc/nginx/sites-enabled/honey.live.conf"
|
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website.conf"
|
||||||
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
|
||||||
elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then
|
elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then
|
||||||
NGINX_CONF="/etc/nginx/conf.d/honey.conf"
|
NGINX_CONF="/etc/nginx/conf.d/honey.conf"
|
||||||
log "Using Nginx config: $NGINX_CONF (conf.d)"
|
log "Using Nginx config: $NGINX_CONF (conf.d)"
|
||||||
elif [ -f "/opt/app/nginx/honey.live.conf" ]; then
|
elif [ -f "/opt/app/nginx/testforapp.website.conf" ]; then
|
||||||
warn "Found config at /opt/app/nginx/honey.live.conf"
|
warn "Found config at /opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..."
|
warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..."
|
||||||
if [ -L "/etc/nginx/sites-enabled/honey.live" ] || [ -L "/etc/nginx/sites-enabled/honey.live.conf" ]; then
|
if [ -L "/etc/nginx/sites-enabled/testforapp.website" ] || [ -L "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
|
||||||
# Find the actual target
|
# Find the actual target
|
||||||
local target=$(readlink -f /etc/nginx/sites-enabled/honey.live 2>/dev/null || readlink -f /etc/nginx/sites-enabled/honey.live.conf 2>/dev/null)
|
local target=$(readlink -f /etc/nginx/sites-enabled/testforapp.website 2>/dev/null || readlink -f /etc/nginx/sites-enabled/testforapp.website.conf 2>/dev/null)
|
||||||
if [ -n "$target" ]; then
|
if [ -n "$target" ]; then
|
||||||
NGINX_CONF="$target"
|
NGINX_CONF="$target"
|
||||||
log "Using Nginx config: $NGINX_CONF (symlink target)"
|
log "Using Nginx config: $NGINX_CONF (symlink target)"
|
||||||
else
|
else
|
||||||
NGINX_CONF="/opt/app/nginx/honey.live.conf"
|
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
NGINX_CONF="/opt/app/nginx/honey.live.conf"
|
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
|
||||||
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
error "Cannot find Nginx config file."
|
error "Cannot find Nginx config file."
|
||||||
error "Searched:"
|
error "Searched:"
|
||||||
error " - /etc/nginx/sites-enabled/honey.live"
|
error " - /etc/nginx/sites-enabled/testforapp.website"
|
||||||
error " - /etc/nginx/sites-enabled/honey.live.conf"
|
error " - /etc/nginx/sites-enabled/testforapp.website.conf"
|
||||||
error " - /etc/nginx/conf.d/honey.conf"
|
error " - /etc/nginx/conf.d/honey.conf"
|
||||||
error " - /opt/app/nginx/honey.live.conf"
|
error " - /opt/app/nginx/testforapp.website.conf"
|
||||||
error ""
|
error ""
|
||||||
error "Please set NGINX_CONF environment variable with the correct path."
|
error "Please set NGINX_CONF environment variable with the correct path."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user