Compare commits
14 Commits
32798cb241
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cc164f24e4 | |||
| 1573f34736 | |||
| 8ff80fdf46 | |||
| 7d5838ea81 | |||
| 9dbce8a3a4 | |||
| 75a9ffe26a | |||
| 486ec457d0 | |||
| 87bc685d6f | |||
| f462454574 | |||
| 51d4555ab2 | |||
| 5cc9aaccee | |||
| eff610142f | |||
| da8790fd21 | |||
| 448779fd7e |
2
.env
2
.env
@@ -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=
|
||||||
|
|||||||
@@ -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` |
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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?))".*$
|
||||||
@@ -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
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|||||||
@@ -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)_
|
|
||||||
Reference in New Issue
Block a user