Compare commits

..

14 Commits

Author SHA1 Message Date
cc164f24e4 🔧 UPDATE: Add CREDENTIAL_ENCRYPTION_KEY to .env for enhanced security configuration. 2025-12-19 13:18:34 +01:00
1573f34736 🔧 UPDATE: Add CREDENTIAL_ENCRYPTION_KEY environment variable to docker-compose configuration for enhanced security. 2025-12-03 12:16:48 +01:00
8ff80fdf46 👌 IMPROVE: DEV-2106 Define logging configuration for your services [2] 2025-10-07 09:23:26 +02:00
7d5838ea81 🔨 REFACTOR: DEV-2052 Excessive HTTP 4xx errors to be 50 errors in 5 min 2025-09-24 15:21:07 +02:00
9dbce8a3a4 🔧 UPDATE: Add custom server volume to docker-compose files for improved asset management across multiple projects. 2025-09-23 09:42:40 +02:00
75a9ffe26a 🔧 UPDATE: Change Redis image to redis:7.2-alpine and update healthcheck and command configurations across multiple docker-compose files. 2025-09-18 07:49:41 +02:00
486ec457d0 👌 IMPROVE: DEV-1999 Improved Pgadmin HealtCheck Browser 2025-09-12 07:39:23 +02:00
87bc685d6f SUPER_ADMIN_USER_PASSWORD To PgAdmin Login 2025-09-11 14:07:50 +00:00
f462454574 Remove no used PGADMIN_DEFAULT_PASSWORD 2025-09-11 14:04:41 +00:00
51d4555ab2 pgadmin Upgrade 2025-09-11 16:01:55 +02:00
5cc9aaccee Accessing the System update 2025-09-11 16:00:32 +02:00
eff610142f DEV-1989 ALL status codes under /pgadmin4 (including 401, 499, 404, etc.) 2025-09-10 17:17:45 +02:00
da8790fd21 Remove resources-limits.md file containing references to Docker Compose resource limits documentation 2025-09-02 17:10:40 +02:00
448779fd7e Add Git installation check to Docker installation script 2025-09-02 17:10:34 +02:00
7 changed files with 425 additions and 374 deletions

2
.env
View File

@@ -2,7 +2,6 @@
NODE_ENV=production NODE_ENV=production
# ====== Database Configuration ====== # ====== Database Configuration ======
POSTGRES_PASSWORD="8*6&Ti3TJxN^" POSTGRES_PASSWORD="8*6&Ti3TJxN^"
PGADMIN_DEFAULT_PASSWORD="8*6&Ti3TJxN^"
DB_NAME="phoenix" DB_NAME="phoenix"
DB_HOST="phoenixDB" DB_HOST="phoenixDB"
DB_PORT=5432 DB_PORT=5432
@@ -23,3 +22,4 @@ REDIS_PASSWORD="8*6&Ti3TJxN^"
# ====== PHX-SYSTEM Configuration ====== # ====== PHX-SYSTEM Configuration ======
PHOENIX_SYSTEM_REPLICAS=1 PHOENIX_SYSTEM_REPLICAS=1
PHX_HOST_NAME= PHX_HOST_NAME=
CREDENTIAL_ENCRYPTION_KEY=

View File

@@ -84,5 +84,5 @@ You can access log services like pgAdmin, Postgres, Phoenix ERP, and others afte
# 🌐 Accessing the System # 🌐 Accessing the System
| **Service** | **URL** | **Credentials** | | **Service** | **URL** | **Credentials** |
|------------------|----------------------------------|----------------------------------------------------| |------------------|----------------------------------|----------------------------------------------------|
| **Phoenix ERP** | [http://localhost:4200](http://localhost:4200) | login: superadmin and password as configured in `.env` | | **Phoenix ERP** | [http://HOST_IP](http://HOST_IP) | login: superadmin and password as configured in `.env` -> `SUPER_ADMIN_USER_PASSWORD` |
| **pgAdmin** | [http://localhost:5050](http://localhost:5050) | Email: `info@phx-erp.de` <br> Password: from `.env` | | **pgAdmin** | [http://HOST_IP/pgadmin4/](http://HOST_IP/pgadmin4/) | Email: `info@phx-erp.de` <br> Password: from `SUPER_ADMIN_USER_PASSWORD` |

View File

@@ -9,9 +9,22 @@ is_wsl() {
grep -qi microsoft /proc/version 2>/dev/null grep -qi microsoft /proc/version 2>/dev/null
} }
check_git_installed() {
if ! command -v git &> /dev/null; then
echo "🔍 Git not found, installing..."
sudo apt-get update
sudo apt-get install -y git
echo "✅ Git installed successfully!"
else
echo "✔️ Git is already installed: $(git --version)"
fi
}
install_docker_linux() { install_docker_linux() {
echo "🔧 Installing Docker on Linux..." echo "🔧 Installing Docker on Linux..."
check_git_installed
# Remove old versions # Remove old versions
sudo apt-get remove -y docker docker-engine docker.io containerd runc || true sudo apt-get remove -y docker docker-engine docker.io containerd runc || true

View File

@@ -44,6 +44,11 @@ services:
restart: always restart: always
image: "postgres:17.5-alpine" image: "postgres:17.5-alpine"
container_name: phoenixDB # Hostname container_name: phoenixDB # Hostname
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# logging: # logging:
# driver: loki # driver: loki
# options: # options:
@@ -79,9 +84,14 @@ services:
retries: 5 # Grace period before health checks start retries: 5 # Grace period before health checks start
pgadmin: pgadmin:
restart: always restart: always
image: dpage/pgadmin4:9.6.0 image: dpage/pgadmin4:9.8.0
container_name: pgadmin4-ui container_name: pgadmin4-ui
user: "5050:5050" user: "5050:5050"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# logging: # logging:
# driver: loki # driver: loki
# options: # options:
@@ -151,15 +161,20 @@ services:
postgres: postgres:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "wget", "-O", "-", "http://localhost:80/misc/ping"] test: ["CMD-SHELL", "wget -qO- http://localhost:80/misc/ping && wget -qO- http://localhost:80/browser/"]
interval: 15s interval: 15s
timeout: 10s timeout: 10s
retries: 5 retries: 5
start_period: 120s start_period: 150s
phoenix-app: phoenix-app:
restart: always restart: always
image: "phxerp/phoenix-app:alpha" image: "phxerp/phoenix-app:alpha"
container_name: phoenix-app container_name: phoenix-app
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
ports: ports:
- '80:80' - '80:80'
- '443:443' - '443:443'
@@ -201,6 +216,11 @@ services:
phoenix-system: phoenix-system:
restart: always restart: always
image: "phxerp/phoenix-system:alpha" image: "phxerp/phoenix-system:alpha"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# logging: # logging:
# driver: loki # driver: loki
# options: # options:
@@ -217,6 +237,7 @@ services:
- "REDIS_PASSWORD=${REDIS_PASSWORD}" - "REDIS_PASSWORD=${REDIS_PASSWORD}"
- NODE_ENV=${NODE_ENV} - NODE_ENV=${NODE_ENV}
- PHX_HOST_NAME=${PHX_HOST_NAME} - PHX_HOST_NAME=${PHX_HOST_NAME}
- CREDENTIAL_ENCRYPTION_KEY=${CREDENTIAL_ENCRYPTION_KEY}
- PERFORMANCE_STRUCTURED_LOGGING=${PERFORMANCE_STRUCTURED_LOGGING} - PERFORMANCE_STRUCTURED_LOGGING=${PERFORMANCE_STRUCTURED_LOGGING}
- PERFORMANCE_WARNING_THRESHOLD=${PERFORMANCE_WARNING_THRESHOLD} - PERFORMANCE_WARNING_THRESHOLD=${PERFORMANCE_WARNING_THRESHOLD}
- PERFORMANCE_DETAILED_MEMORY=${PERFORMANCE_DETAILED_MEMORY} - PERFORMANCE_DETAILED_MEMORY=${PERFORMANCE_DETAILED_MEMORY}
@@ -250,7 +271,7 @@ services:
start_period: 60s # Grace period before health checks start start_period: 60s # Grace period before health checks start
volumes: volumes:
- "./assets:/usr/src/app/packages/dev-server/assets" - "./assets:/usr/src/app/packages/dev-server/assets"
- "./server_custom:/usr/src/app/packages/dev-server/custom"
# - "./logs:/usr/src/app/packages/dev-server/logs" # - "./logs:/usr/src/app/packages/dev-server/logs"
phoenix-worker: phoenix-worker:
restart: always restart: always
@@ -258,6 +279,11 @@ services:
container_name: "phoenix-worker" container_name: "phoenix-worker"
ports: ports:
- "3001:3001" # Restrict to only allow access from Grafana Server IP - "3001:3001" # Restrict to only allow access from Grafana Server IP
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# logging: # logging:
# driver: loki # driver: loki
# options: # options:
@@ -276,6 +302,7 @@ services:
- REDIS_PASSWORD=${REDIS_PASSWORD} - REDIS_PASSWORD=${REDIS_PASSWORD}
- NODE_ENV=${NODE_ENV} - NODE_ENV=${NODE_ENV}
- PHX_HOST_NAME=${PHX_HOST_NAME} - PHX_HOST_NAME=${PHX_HOST_NAME}
- CREDENTIAL_ENCRYPTION_KEY=${CREDENTIAL_ENCRYPTION_KEY}
- PERFORMANCE_STRUCTURED_LOGGING=${PERFORMANCE_STRUCTURED_LOGGING} - PERFORMANCE_STRUCTURED_LOGGING=${PERFORMANCE_STRUCTURED_LOGGING}
- PERFORMANCE_WARNING_THRESHOLD=${PERFORMANCE_WARNING_THRESHOLD} - PERFORMANCE_WARNING_THRESHOLD=${PERFORMANCE_WARNING_THRESHOLD}
- PERFORMANCE_DETAILED_MEMORY=${PERFORMANCE_DETAILED_MEMORY} - PERFORMANCE_DETAILED_MEMORY=${PERFORMANCE_DETAILED_MEMORY}
@@ -306,13 +333,16 @@ services:
start_period: 30s # Grace period before health checks start start_period: 30s # Grace period before health checks start
volumes: volumes:
- "./assets:/usr/src/app/packages/dev-server/assets" - "./assets:/usr/src/app/packages/dev-server/assets"
- "./server_custom:/usr/src/app/packages/dev-server/custom"
# - "./logs:/usr/src/app/packages/dev-server/logs" # - "./logs:/usr/src/app/packages/dev-server/logs"
phoenix-redis: phoenix-redis:
image: 'bitnami/redis:latest' image: redis:7.2-alpine
container_name: redis container_name: redis
command: /opt/bitnami/scripts/redis/run.sh # Not good, but as agreed. At some point i can start using this: --maxmemory + add eviction policy logging:
user: root driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# logging: # logging:
# driver: loki # driver: loki
# options: # options:
@@ -324,8 +354,7 @@ services:
- backend - backend
restart: always restart: always
environment: environment:
ALLOW_EMPTY_PASSWORD: "no" TZ: Europe/Berlin
REDIS_PASSWORD: ${REDIS_PASSWORD}
# deploy: # deploy:
# restart_policy: # Define how the service should restart when it fails # restart_policy: # Define how the service should restart when it fails
# condition: on-failure # Only restart if the container exits with a non-zero code # condition: on-failure # Only restart if the container exits with a non-zero code
@@ -339,11 +368,22 @@ services:
# reservations: # Guaranteed minimum resources for the container # reservations: # Guaranteed minimum resources for the container
# cpus: "0.05" # Reserved CPU cores (5% of one core) # cpus: "0.05" # Reserved CPU cores (5% of one core)
# memory: 32M # Reserved memory (32 megabytes) # memory: 32M # Reserved memory (32 megabytes)
command: >
redis-server
--requirepass ${REDIS_PASSWORD}
healthcheck:
test: [
"CMD-SHELL",
"redis-cli -a ${REDIS_PASSWORD} ping | grep PONG && test -w /data"
]
interval: 5s
retries: 10
timeout: 5s
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
volumes: volumes:
- "./redis/data:/bitnami/redis/data" - ./redis/data:/data
networks: networks:
backend: backend:

View File

@@ -1,6 +1,11 @@
[Definition] [Definition]
# Match either x_forwarded_for (preferred) or remote_addr
# ✅ Match any 4xx status (including 401, 499) for all paths
failregex = ^.*"x_forwarded_for":"<HOST>".*"status":4\d\d.*$ failregex = ^.*"x_forwarded_for":"<HOST>".*"status":4\d\d.*$
^.*"remote_addr":"<HOST>".*"status":4\d\d.*$ ^.*"remote_addr":"<HOST>".*"status":4\d\d.*$
ignoreregex = ^.*"request_uri":"\/(?:stub_status|health\/system|health\/worker|pgadmin4(?:\/|$)|\.well-known\/acme-challenge\/|.*\.(?:css|js|png|jpg|jpeg|gif|svg|ico|webp|woff2?))".*$ # ❌ Ignore:
# - ALL status codes under /pgadmin4 (including 401, 499, 404, etc.)
# - Static files and known safe URIs
ignoreregex = ^.*"request_uri":"\/pgadmin4(?:\/[^"]*)?".*$
^.*"request_uri":"\/(?:stub_status|health\/system|health\/worker|\.well-known\/acme-challenge\/[^"]*|[^"]*\.(?:css|js|png|jpg|jpeg|gif|svg|ico|webp|woff2?))".*$

View File

@@ -47,7 +47,7 @@ filter = nginx-4xx
logpath = /data/nginx-logs/access_json.log logpath = /data/nginx-logs/access_json.log
port = 80,443,3000 port = 80,443,3000
findtime = 5m findtime = 5m
maxretry = 20 maxretry = 50
bantime = 15m bantime = 15m
# ----------------------------- # -----------------------------

View File

@@ -1,7 +0,0 @@
## 📚 **References**
- **YouTrack Documentation:** [Docker Compose Resource Limits](https://phx-erp.youtrack.cloud/articles/INT-A-107/Docker-Compose-Resource-Limits) - Comprehensive resource allocation guide for Phoenix ERP stack
- **Docker Documentation:** [Resource constraints](https://docs.docker.com/config/containers/resource_constraints/)
- **Docker Compose:** [Deploy specification](https://docs.docker.com/compose/compose-file/deploy/)
_Last updated: 2025-07-16 (Comprehensive revision based on production docker-compose.yaml)_