commit 98cf294a0cdd45ad693b6a333a3811358d6abfde Author: Dmitry Gusev Date: Thu May 7 01:35:20 2026 +0300 feat: initial dockerized 301 redirect to sag24.ru nginx:alpine container, listens 8080, returns 301 -> https://sag24.ru$request_uri. Mapped to host port 4083 on web.hhivp.com via docker-compose. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c821d14 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +*.local +docker-compose.override.yml +secrets/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fef866c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +# syntax=docker/dockerfile:1.7 +FROM nginx:1.27-alpine + +COPY nginx.conf /etc/nginx/nginx.conf + +EXPOSE 8080 + +HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ + CMD wget -qO- http://127.0.0.1:8080/ -I 2>&1 | grep -q "301 Moved" || exit 1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebce836 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# sysadmingroup-website + +`sysadmingroup.ru` — алиас-домен для `sag24.ru`. +Контейнер `nginx:alpine` отдаёт `301 Moved Permanently` → `https://sag24.ru$request_uri`. + +## Деплой + +На `web.hhivp.com`: + +```bash +cd /opt/docker/sites/sysadmingroup-ru +git pull +docker compose build +docker compose up -d +``` + +Host nginx vhost (`/etc/nginx/conf.d/sysadmingroup.ru`) терминирует SSL и проксирует на `127.0.0.1:4083`. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4cf9365 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +services: + sysadmingroup-ru: + build: + context: . + dockerfile: Dockerfile + image: sysadmingroup-ru:latest + container_name: sysadmingroup-ru + restart: unless-stopped + ports: + - "127.0.0.1:4083:8080" + healthcheck: + test: ["CMD", "wget", "-qO-", "-I", "http://127.0.0.1:8080/"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 5s + +# Деплой на web (45.10.53.206): +# - /opt/docker/sites/sysadmingroup-ru/ ← git clone сюда +# Команды: +# cd /opt/docker/sites/sysadmingroup-ru && git pull && docker compose build && docker compose up -d diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..959dce1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,21 @@ +worker_processes auto; +error_log /dev/stderr warn; +pid /var/run/nginx.pid; + +events { + worker_connections 256; +} + +http { + server_tokens off; + access_log /dev/stdout combined; + + server { + listen 8080 default_server; + server_name _; + + location / { + return 301 https://sag24.ru$request_uri; + } + } +}