186 lines
6.2 KiB
YAML
Executable File
186 lines
6.2 KiB
YAML
Executable File
version: "2.1"
|
|
services:
|
|
postgres:
|
|
restart: always
|
|
image: "postgres:15.1-alpine"
|
|
container_name: phoenixDB
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- DEBUG=false
|
|
- POSTGRES_DB=phoenix
|
|
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
|
|
volumes:
|
|
- "db-data:/var/lib/postgresql/data"
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U postgres
|
|
interval: 5s
|
|
timeout: 2s
|
|
retries: 5
|
|
networks:
|
|
- postgres
|
|
pgadmin:
|
|
restart: always
|
|
image: dpage/pgadmin4
|
|
container_name: pgadmin_container
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: "pgadmin4@pgadmin.org"
|
|
PGADMIN_DEFAULT_PASSWORD: '${PGADMIN_DEFAULT_PASSWORD}'
|
|
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
|
ports:
|
|
- "${PGADMIN_PORT:-5050}:80"
|
|
volumes:
|
|
- "pgadmin:/var/lib/pgadmin"
|
|
networks:
|
|
- postgres
|
|
phoenix-app:
|
|
restart: always
|
|
image: "dennx/phoenix-app:alpha"
|
|
container_name: phoenixAppProd
|
|
volumes:
|
|
- "/opt/containers/phx/app_custom:/usr/share/nginx/html/assets/custom"
|
|
- "/opt/containers/phx/nginx/nginx.conf:/etc/nginx/nginx.conf"
|
|
# - phxnginx:/etc/nginx
|
|
ports:
|
|
- "8081:80"
|
|
# - "443:443"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.phxalpha.entrypoints=https"
|
|
- "traefik.http.routers.phxalpha.rule=Host(`alpha.phx-erp.de`)"
|
|
- "traefik.http.routers.phxalpha.middlewares=secHeaders@file"
|
|
- "traefik.http.routers.phxalpha.tls=true"
|
|
- "traefik.http.routers.phxalpha.tls.certresolver=http"
|
|
- "traefik.http.routers.phxalpha.service=phxalpha"
|
|
- "traefik.http.services.phxalpha.loadbalancer.server.port=80"
|
|
- "traefik.docker.network=proxy"
|
|
|
|
- "traefik.http.routers.phxalpha-insecure.entrypoints=http"
|
|
- "traefik.http.routers.phxalpha-insecure.rule=Host(`alpha.phx-erp.de`)"
|
|
- "traefik.http.routers.phxalpha-insecure.tls=false"
|
|
networks:
|
|
- proxy
|
|
- postgres
|
|
depends_on:
|
|
- phoenix-system
|
|
phoenix-system:
|
|
restart: always
|
|
image: "dennx/phoenix-system:alpha"
|
|
# container_name: phoenixSystemProd
|
|
# env_file: .env
|
|
environment:
|
|
- DB_HOST=phoenixDB
|
|
- "DB_PASSWORD=${POSTGRES_PASSWORD}"
|
|
- DB_USERNAME=postgres
|
|
- "SUPER_ADMIN_USER_PASSWORD=${SUPER_ADMIN_USER_PASSWORD}"
|
|
- RUN_JOB_QUEUE=${RUN_JOB_QUEUE}
|
|
- SMTP_FROM=${SMTP_FROM}
|
|
- SMTP_TYPE=${SMTP_TYPE}
|
|
- SMTP_NAME=${SMTP_NAME}
|
|
- SMTP_HOST=${SMTP_HOST}
|
|
- SMTP_PORT=${SMTP_PORT}
|
|
- SMTP_SECURE=${SMTP_SECURE}
|
|
- SMTP_USER=${SMTP_USER}
|
|
- SMTP_PASS=${SMTP_PASS}
|
|
- SMTP_LOGGING=${SMTP_LOGGING}
|
|
- SMTP_DEBUG=${SMTP_DEBUG}
|
|
- SMTP_TLS_REJECT_UNAUTHORIZED=${SMTP_TLS_REJECT_UNAUTHORIZED}
|
|
- SMTP_SECURE_CONNECTION=${SMTP_SECURE_CONNECTION}
|
|
- ENV_MODE=${ENV_MODE}
|
|
- NODE_ENV=${NODE_ENV}
|
|
- SMTP_TLS_CIPHERS={SMTP_TLS_CIPHERS}
|
|
- BILL_BEE_ACTIVE=${BILL_BEE_ACTIVE}
|
|
- CHANNEL_PILOT_PRO_ACTIVE=${CHANNEL_PILOT_PRO_ACTIVE}
|
|
- SHOPIFY_ACTIVE=${SHOPIFY_ACTIVE}
|
|
command: ["npm", "run", "start:server"]
|
|
# ports:
|
|
# - "3000:3000"
|
|
# - "3400:3400"
|
|
# - "9615:9615"
|
|
# - "587:587" # Email Port
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- "./logs:/usr/src/app/packages/dev-server/logs"
|
|
- "asset-data:/usr/src/app/packages/dev-server/assets"
|
|
- "/opt/containers/phx/server_custom:/usr/src/app/packages/dev-server/custom" # it seems tobe no effect if we make changes, not 100% of sure!
|
|
networks:
|
|
- postgres
|
|
deploy:
|
|
replicas: 1
|
|
phoenix-worker:
|
|
restart: always
|
|
image: "dennx/phoenix-system:alpha"
|
|
environment:
|
|
- DB_HOST=phoenixDB
|
|
- "DB_PASSWORD=${POSTGRES_PASSWORD}"
|
|
- DB_USERNAME=postgres
|
|
- "SUPER_ADMIN_USER_PASSWORD=${SUPER_ADMIN_USER_PASSWORD}"
|
|
- REDIS_PASSWORD=${REDIS_PASSWORD}
|
|
# command: ["npm", "run", "start:worker"]
|
|
entrypoint: ./entrypoint-phoenix-worker.sh
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
# - "/opt/containers/phx/assets:/usr/src/app/packages/dev-server/custo/assets"
|
|
# - "asset-data:/usr/src/app/packages/dev-server/assets"
|
|
- "/opt/containers/phx/server_custom:/usr/src/app/packages/dev-server/custom"
|
|
- "./logs:/usr/src/app/packages/dev-server/logs"
|
|
networks:
|
|
- postgres
|
|
node_exporter:
|
|
image: quay.io/prometheus/node-exporter:latest
|
|
container_name: node_exporter
|
|
ports:
|
|
- "9100:9100" # Exposing the metrics port
|
|
networks:
|
|
- metrics
|
|
restart: unless-stopped
|
|
command:
|
|
- "--path.procfs=/host/proc"
|
|
- "--path.sysfs=/host/sys"
|
|
- "--path.rootfs=/host"
|
|
- "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev)($$|/)"
|
|
volumes:
|
|
- "/proc:/host/proc:ro"
|
|
- "/sys:/host/sys:ro"
|
|
- "/:/host:ro,rslave"
|
|
phoenix-redis:
|
|
image: 'bitnami/redis:latest'
|
|
container_name: redis
|
|
#command: redis-server --save 20 1 --appendonly no --requirepass ${REDIS_PASSWORD} --loglevel warning
|
|
command: /opt/bitnami/scripts/redis/run.sh --maxmemory 100mb --appendonly no
|
|
user: root # Non-root user in Bitnami images The /bitnami/redis/data directory inside the container is already owned by 1001, avoiding permission issues.
|
|
restart: always
|
|
environment:
|
|
# REDIS_APPENDFSYNC: "always"
|
|
ALLOW_EMPTY_PASSWORD: "no"
|
|
# REDIS_DISABLE_COMMANDS: FLUSHDB,FLUSHALL,CONFIG
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
|
healthcheck:
|
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
|
networks:
|
|
- postgres
|
|
volumes:
|
|
- /opt/containers/phx/redis/data:/bitnami/redis/data
|
|
- /opt/containers/phx/redis/tmp:/opt/bitnami/redis/tmp # ✅ Fix permission issue
|
|
# - /opt/containers/phx/redis/logs:/opt/bitnami/redis/logs # ✅ Fix logs permission issue
|
|
# - ./redis.conf:/opt/bitnami/redis/etc/redis.conf # ✅ Use a writable redis.conf
|
|
volumes:
|
|
db-data: null
|
|
app-data: null
|
|
asset-data: null
|
|
pgadmin: null
|
|
|
|
networks:
|
|
postgres:
|
|
driver: bridge
|
|
proxy:
|
|
external: true
|
|
metrics:
|
|
driver: bridge
|