56
This commit is contained in:
@@ -6,9 +6,8 @@ services:
|
||||
POSTGRES_USER: ${DB_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
||||
POSTGRES_DB: ${DB_NAME:-pg_admin}
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8"
|
||||
ports:
|
||||
- "${DB_PORT:-5432}:5432"
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8 -c shared_buffers=256MB -c max_connections=100"
|
||||
# БД НЕ открыта наружу - только для контейнеров
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./docker/init-db.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
@@ -19,6 +18,15 @@ services:
|
||||
retries: 5
|
||||
networks:
|
||||
- pg-admin-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
backend:
|
||||
build:
|
||||
@@ -37,8 +45,7 @@ services:
|
||||
JWT_EXPIRE: ${JWT_EXPIRE:-7d}
|
||||
MAX_CONNECTIONS: ${MAX_CONNECTIONS:-20}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
ports:
|
||||
- "${API_PORT:-3000}:${API_PORT:-3000}"
|
||||
# API НЕ открыт наружу - только для nginx
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -48,6 +55,14 @@ services:
|
||||
networks:
|
||||
- pg-admin-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
frontend:
|
||||
build:
|
||||
@@ -57,8 +72,7 @@ services:
|
||||
environment:
|
||||
REACT_APP_API_URL: ${FRONTEND_API_URL:-http://localhost:3000/api}
|
||||
REACT_APP_ENV: ${NODE_ENV:-production}
|
||||
ports:
|
||||
- "${FRONTEND_PORT:-80}:3000"
|
||||
# Frontend НЕ открыт наружу - только для nginx
|
||||
depends_on:
|
||||
- backend
|
||||
volumes:
|
||||
@@ -66,14 +80,20 @@ services:
|
||||
networks:
|
||||
- pg-admin-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: pg-admin-cache
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
environment:
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-change_me}
|
||||
# Redis НЕ открыт наружу - только для контейнеров
|
||||
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
@@ -84,12 +104,20 @@ services:
|
||||
networks:
|
||||
- pg-admin-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 128M
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: pg-admin-proxy
|
||||
ports:
|
||||
- "${NGINX_PORT:-8080}:80"
|
||||
- "${NGINX_PORT:-80}:80"
|
||||
volumes:
|
||||
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
depends_on:
|
||||
@@ -98,6 +126,14 @@ services:
|
||||
networks:
|
||||
- pg-admin-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 128M
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user