189 lines
5.8 KiB
YAML
189 lines
5.8 KiB
YAML
version: "2.1"
|
|
services:
|
|
postgres:
|
|
restart: always
|
|
image: "postgres:15.1-alpine"
|
|
container_name: phoenixDB
|
|
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: "yurimatoslima/phoenix-frontend:alpha"
|
|
container_name: phoenixAppProd
|
|
volumes:
|
|
- "/app_custom:/usr/share/nginx/html/assets/custom"
|
|
# - "/nginx/nginx.conf:/etc/nginx/nginx.conf" # Not working !!!!!!!!!
|
|
# - 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: "yurimatoslima/phoenix-backend: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}
|
|
- SMTP_TLS_CIPHERS=SSLv3={SMTP_TLS_CIPHERS}
|
|
command: [ "npm", "run", "start:server" ]
|
|
# ports:
|
|
# - "3000:3000"
|
|
# - "3400:3400"
|
|
# - "9615:9615"
|
|
# - "587:587" # Email Port
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- "asset-data:/usr/src/app/packages/dev-server/assets"
|
|
- "/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: "yurimatoslima/phoenix-backend: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" ]
|
|
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"
|
|
- "/server_custom:/usr/src/app/packages/dev-server/custom"
|
|
networks:
|
|
- postgres
|
|
|
|
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
|
|
user: root
|
|
# privileged: true
|
|
# ports:
|
|
# - 6379:6379
|
|
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:
|
|
- /redis/data:/bitnami/redis/data
|
|
|
|
https_portal:
|
|
container_name: https_portal
|
|
image: "steveltn/https-portal:1.21"
|
|
restart: unless-stopped
|
|
user: "root"
|
|
networks:
|
|
- postgres # primary network [external]
|
|
- proxy # internal network
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
environment:
|
|
STAGE: "production" # Use Let's Encrypt production server
|
|
WEBSOCKET: "true" # Enable websocket support
|
|
DEBUG: "true"
|
|
RENEW_MARGIN_DAYS: 30
|
|
# FORCE_RENEW: 'true'
|
|
DOMAINS: 'yuri.phx-erp.de -> http://phoenix-app:80'
|
|
volumes:
|
|
- ./volumes/https_portal/data:/var/lib/https-portal # ssl_certs, vhost.d, htdocs
|
|
- ./volumes/https_portal/log:/var/log/nginx # nginx logs
|
|
depends_on:
|
|
- phoenix-app
|
|
- phoenix-system
|
|
- pgadmin
|
|
- phoenix-redis
|
|
- postgres
|
|
volumes:
|
|
db-data: null
|
|
app-data: null
|
|
asset-data: null
|
|
pgadmin: null
|
|
|
|
networks:
|
|
postgres:
|
|
name: postgres
|
|
driver: bridge
|
|
proxy:
|
|
name: proxy
|
|
driver: bridge
|