From 44fe648ebcf35e3f20567a4aceeae1f4dfc2cc97 Mon Sep 17 00:00:00 2001 From: Liutenko Oleksandr Date: Fri, 25 Sep 2026 20:23:12 +0300 Subject: [PATCH] Add production compose overlay for deploy behind Nginx Proxy Manager The prod overlay drops host ports for api/frontend and attaches frontend to the server's external `web` network (alias lux-fiscal-frontend), where NPM terminates TLS for asist.ystyle.com.ua. migrate/api/worker now share a single lux-fiscal-backend image instead of three identical copies. Co-Authored-By: Claude Opus 5.5 --- docker-compose.prod.yml | 21 +++++++++++++++++++++ docker-compose.yml | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 docker-compose.prod.yml diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..d6fcdc8 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,21 @@ +# Прод-оверлей: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build +# +# TLS и публичный домен держит Nginx Proxy Manager сервера (внешняя сеть `web`). +# Наружу торчит только frontend — и то лишь в сеть `web`, без портов на хосте; +# api/postgres/redis доступны исключительно внутри сети compose. + +services: + api: + ports: !reset [] + + frontend: + ports: !reset [] + networks: + default: + web: + # Имя, по которому NPM проксирует: Forward Hostname = lux-fiscal-frontend, порт 80. + aliases: [lux-fiscal-frontend] + +networks: + web: + external: true diff --git a/docker-compose.yml b/docker-compose.yml index ff3cdc6..ea70939 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: # Миграции выполняются отдельным одноразовым контейнером, а не при старте api. # Иначе при нескольких репликах api они пошли бы параллельно. migrate: + # Один образ на migrate/api/worker, а не три одинаковых копии на диске. + image: lux-fiscal-backend:latest build: context: ./backend env_file: .env @@ -48,6 +50,7 @@ services: restart: "no" api: + image: lux-fiscal-backend:latest build: context: ./backend restart: unless-stopped @@ -68,6 +71,7 @@ services: - receipt_storage:/app/storage worker: + image: lux-fiscal-backend:latest build: context: ./backend restart: unless-stopped -- 2.54.0