diff --git a/deploy/docker-compose.prod.yml b/deploy/docker-compose.prod.yml index 8381f72..e4ae2f1 100644 --- a/deploy/docker-compose.prod.yml +++ b/deploy/docker-compose.prod.yml @@ -148,7 +148,7 @@ configs: caddyfile: content: | # ATCR AppView - Main registry + web UI - {$APPVIEW_DOMAIN} { + ${APPVIEW_DOMAIN:-atcr.io} { # Reverse proxy to AppView container reverse_proxy atcr-appview:5000 { # Preserve original host header @@ -171,7 +171,7 @@ configs: } # ATCR Hold Service - Storage presigned URL generator - {$HOLD_DOMAIN} { + ${HOLD_DOMAIN:-hold01.atcr.io} { # Reverse proxy to Hold service container reverse_proxy atcr-hold:8080 { # Preserve original host header diff --git a/deploy/init-upcloud.sh b/deploy/init-upcloud.sh index 7cbb948..f1c8b38 100644 --- a/deploy/init-upcloud.sh +++ b/deploy/init-upcloud.sh @@ -7,8 +7,8 @@ # # What it does: # - Updates system packages +# - Creates 2GB swap file (for 1GB RAM instances) # - Installs Docker and Docker Compose -# - Configures firewall (ports 80, 443, 22) # - Creates directory structure # - Clones ATCR repository # - Creates systemd service for auto-start @@ -62,6 +62,23 @@ dnf install -y \ log_info "Required ports: HTTP (80), HTTPS (443), SSH (22)" +# Create swap file for instances with limited RAM +if [ ! -f /swapfile ]; then + log_info "Creating 2GB swap file (allows builds on 1GB RAM instances)..." + dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress + chmod 600 /swapfile + mkswap /swapfile + swapon /swapfile + + # Make swap permanent + echo '/swapfile none swap sw 0 0' >> /etc/fstab + + log_info "Swap file created and enabled" + free -h +else + log_info "Swap file already exists" +fi + # Install Docker if ! command_exists docker; then log_info "Installing Docker..."