chore(deploy): подготовить отдельный тестовый Docker-стенд
This commit is contained in:
1 parent
6255f44975
commit
4d88b97d49
6 files changed
+195
-5
No files matched your search
@@ -0,0 +1,119 @@
|
||||
name: mmapp-test
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: ${POSTGRES_IMAGE_TAG:-postgres:18-alpine}
|
||||
container_name: mmapp-test-postgres
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
shm_size: "256mb"
|
||||
environment:
|
||||
POSTGRES_USER: mmapp
|
||||
POSTGRES_DB: mmapp
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C.UTF-8 --data-checksums"
|
||||
TZ: UTC
|
||||
PGTZ: UTC
|
||||
command:
|
||||
- postgres
|
||||
- -c
|
||||
- timezone=UTC
|
||||
- -c
|
||||
- listen_addresses=*
|
||||
- -c
|
||||
- max_connections=100
|
||||
- -c
|
||||
- shared_buffers=256MB
|
||||
- -c
|
||||
- work_mem=16MB
|
||||
- -c
|
||||
- maintenance_work_mem=128MB
|
||||
- -c
|
||||
- wal_compression=lz4
|
||||
- -c
|
||||
- default_toast_compression=lz4
|
||||
- -c
|
||||
- io_method=worker
|
||||
- -c
|
||||
- io_workers=3
|
||||
- -c
|
||||
- effective_io_concurrency=200
|
||||
- -c
|
||||
- max_wal_size=2GB
|
||||
- -c
|
||||
- checkpoint_timeout=15min
|
||||
- -c
|
||||
- checkpoint_completion_target=0.9
|
||||
volumes:
|
||||
# PostgreSQL 18+: VOLUME is /var/lib/postgresql (PGDATA = .../18/docker)
|
||||
- mmapp-pgdata:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U mmapp -d mmapp"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
backend:
|
||||
image: mmapp-test/backend:${MMAPP_IMAGE_TAG:?set MMAPP_IMAGE_TAG}
|
||||
container_name: mmapp-test-backend
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "127.0.0.1:8000:8000"
|
||||
# IPFIX: только на WG-адресе хоста после `wg-quick up wg-flow`, не 0.0.0.0
|
||||
# - "10.255.254.1:4739:4739/udp"
|
||||
environment:
|
||||
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
|
||||
DATABASE_URL: postgres://mmapp:${POSTGRES_PASSWORD}@postgres:5432/mmapp
|
||||
DATABASE_PATH: /app/data/mikrotik.db
|
||||
AUTH_REQUIRED: ${AUTH_REQUIRED:-false}
|
||||
AUTH_JWT_SECRET: ${AUTH_JWT_SECRET:?set AUTH_JWT_SECRET}
|
||||
AUTH_ISSUER: ${AUTH_ISSUER:-https://auth.test.local}
|
||||
AUTH_PORTAL_URL: ${AUTH_PORTAL_URL:-http://localhost:5175}
|
||||
# IPFIX: внутри контейнера слушаем все интерфейсы; на хосте UDP 4739 публикуется только на WG-IP
|
||||
FLOW_LISTEN_HOST: "0.0.0.0"
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"node",
|
||||
"-e",
|
||||
"fetch('http://127.0.0.1:8000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 300s
|
||||
|
||||
frontend:
|
||||
image: mmapp-test/frontend:${MMAPP_IMAGE_TAG:?set MMAPP_IMAGE_TAG}
|
||||
container_name: mmapp-test-frontend
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "127.0.0.1:3000:3000"
|
||||
environment:
|
||||
BACKEND_INTERNAL_URL: http://backend:8000
|
||||
|
||||
|
||||
volumes:
|
||||
mmapp-pgdata:
|
||||
@@ -0,0 +1,9 @@
|
||||
# Save as /opt/mmapp-test/.env on the test server (mode 0600).
|
||||
# Generate unique hex secrets on that server; never reuse production credentials.
|
||||
POSTGRES_PASSWORD=
|
||||
AUTH_JWT_SECRET=
|
||||
MMAPP_IMAGE_TAG=ux-6255f44
|
||||
AUTH_REQUIRED=false
|
||||
AUTH_ISSUER=https://auth.test.local
|
||||
AUTH_PORTAL_URL=http://localhost:5175
|
||||
CORS_ORIGIN=http://localhost:3000
|
||||
Reference in new issue
Block a user