👌 IMPROVE: New Docker Compose

This commit is contained in:
Yuri-Lima
2023-08-24 15:51:32 +00:00
parent 51f0ebe23c
commit f712e9522a

View File

@@ -1,44 +1,11 @@
version: "2.1"
networks:
backend:
external: true
services:
postgres:
phoenix-frontend:
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
image: "yurimatoslima/phoenix-frontend:alpha"
volumes:
- "/opt/containers/phx/app_custom:/usr/share/nginx/html/assets/custom"
- "/opt/containers/phx/nginx/nginx.conf:/etc/nginx/nginx.conf"
@@ -46,29 +13,13 @@ services:
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
- frontend
depends_on:
- phoenix-system
phoenix-system:
- phoenix-backend
phoenix-backend:
restart: always
image: "dennx/phoenix-system:alpha"
# container_name: phoenixSystemProd
image: "yurimatoslima/phoenix-backend:alpha"
# env_file: .env
environment:
- DB_HOST=phoenixDB
@@ -89,7 +40,7 @@ services:
- SMTP_SECURE_CONNECTION=${SMTP_SECURE_CONNECTION}
- SMTP_IGNORE_TLS=${SMTP_IGNORE_TLS}
- ENV_MODE=${ENV_MODE}
command: ["npm", "run", "start:server"]
command: [ "npm", "run", "start:server" ]
# ports:
# - "3000:3000"
# - "3400:3400"
@@ -102,19 +53,19 @@ services:
- "asset-data:/usr/src/app/packages/dev-server/assets"
- "/opt/containers/phx/server_custom:/usr/src/app/packages/dev-server/custom"
networks:
- postgres
- backend
deploy:
replicas: 2
phoenix-worker:
phoenix-backend-worker:
restart: always
image: "dennx/phoenix-system:alpha"
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"]
command: [ "npm", "run", "start:worker" ]
depends_on:
postgres:
condition: service_healthy
@@ -123,35 +74,8 @@ services:
# - "asset-data:/usr/src/app/packages/dev-server/assets"
- "/opt/containers/phx/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}
networks:
- postgres
volumes:
- /opt/containers/phx/redis/data:/bitnami/redis/data
- backend
volumes:
db-data: null
app-data: null
asset-data: null
pgadmin: null
networks:
postgres:
driver: bridge
proxy:
external: true