Skip to content

Commit

Permalink
Merge pull request #83 from dorel14/dev
Browse files Browse the repository at this point in the history
update docker-compose.yml
  • Loading branch information
dorel14 authored Nov 17, 2024
2 parents d76fe8b + 4f5648b commit bf8910d
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ services:
- custom_network
ports:
- 5432:5432
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
env_file:
- .env
user: root
volumes:
- ./db_folder/pg_12:/var/lib/postgresql/data
- ./db_init/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./db_folder/pg_12b:/var/lib/postgresql/data
healthcheck:
test:
["CMD","pg_isready", "-U","${POSTGRES_USER}"]
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"]
interval: 30s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -46,7 +49,7 @@ services:
- WAIT_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=30
- WAIT_HOST_CONNECT_TIMEOUT=30
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_SERVER}:${POSTGRES_PORT}/${POSTGRES_DB}
# - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_SERVER}:${POSTGRES_PORT}/${POSTGRES_DB}
healthcheck:
test: curl http://webapi:8000/healthcheck || exit 1
interval: 30s
Expand All @@ -55,12 +58,11 @@ services:
start_period: 60s
labels:
- "traefik.enable=true"
- "traefik.http.routers.webapi.rule=Host(`${WEB_SERVER_NAME}`) && PathPrefix(`/webapi`)"
- "traefik.http.routers.webapi.rule=Host(`${WEB_SERVER_NAME:-localhost}`) && PathPrefix(`/webapi`)"
- "traefik.http.services.webapi.loadbalancer.server.port=8000"
- "traefik.http.middlewares.webapi-strip.stripprefix.prefixes=/webapi"
- "traefik.http.routers.webapi.middlewares=webapi-strip@docker"


webapp:
build:
context: .
Expand All @@ -74,28 +76,26 @@ services:
volumes:
- webapp-dir:/webapp
env_file:
- .env
- .env
healthcheck:
test: curl http://webapp:8181/healthcheck || exit 1
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
start_period: 30s
environment:
- CONTAINER_NAME=webapp
- API_URL=http://webapi:8000
depends_on:
webapi:
condition: service_healthy
webapi:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.webapp.rule=Host(`${WEB_SERVER_NAME}`) && PathPrefix(`/webapp`)"
- "traefik.http.routers.webapp.rule=Host(`${WEB_SERVER_NAME:-localhost}`) && PathPrefix(`/webapp`)"
- "traefik.http.services.webapp.loadbalancer.server.port=8181"
- "traefik.http.middlewares.webapp-strip.stripprefix.prefixes=/webapp"
- "traefik.http.routers.webapp.middlewares=webapp-strip@docker"



3cxcdrserver:
build:
context: .
Expand All @@ -106,7 +106,7 @@ services:
ports:
- 5000:5000
env_file:
- .env
- .env
depends_on:
webapi:
condition: service_healthy
Expand All @@ -118,7 +118,7 @@ services:
- WAIT_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=30
- WAIT_HOST_CONNECT_TIMEOUT=30
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_SERVER}:${POSTGRES_PORT}/${POSTGRES_DB}
# - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_SERVER}:${POSTGRES_PORT}/${POSTGRES_DB}
volumes:
- app-code:/home/appuser/app
#- ./srv/datas:/home/appuser/cdrfiles
Expand All @@ -134,7 +134,7 @@ services:
networks:
- custom_network
ports:
- 5555:80
- 5555:80
env_file:
- .env
environment:
Expand All @@ -146,14 +146,13 @@ services:
- pgadmin_data:/var/lib/pgadmin/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin.rule=Host(`${WEB_SERVER_NAME}`) && PathPrefix(`/pgadmin`)"
- "traefik.http.routers.pgadmin.rule=Host(`${WEB_SERVER_NAME:-localhost}`) && PathPrefix(`/pgadmin`)"
- "traefik.http.services.pgadmin.loadbalancer.server.port=8006"
- "traefik.http.middlewares.pgadmin-strip.stripprefix.prefixes=/pgadmin"
- "traefik.http.middlewares.pgadmin-headers.headers.customRequestHeaders.X-Script-Name=/pgadmin"
- "traefik.http.middlewares.pgadmin-headers.headers.customRequestHeaders.X-Scheme=http"
- "traefik.http.routers.pgadmin.middlewares=pgadmin-strip@docker,pgadmin-headers@docker"


grafana:
image: grafana/grafana:latest
environment:
Expand All @@ -174,10 +173,9 @@ services:
- ./grafana_init/provisioning/dashboards/dashboard_files/:/var/lib/grafana/dashboards/
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`${WEB_SERVER_NAME}`) && PathPrefix(`/grafana`)"
- "traefik.http.routers.grafana.rule=Host(`${WEB_SERVER_NAME:-localhost}`) && PathPrefix(`/grafana`)"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"


traefik:
image: traefik:v2.10
env_file:
Expand All @@ -196,10 +194,9 @@ services:
networks:
- custom_network
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik-api.rule=Host(`${WEB_SERVER_NAME}`)"
- "traefik.http.routers.traefik-api.service=api@internal"

- "traefik.enable=true"
- "traefik.http.routers.traefik-api.rule=Host(`${WEB_SERVER_NAME:-localhost}`)"
- "traefik.http.routers.traefik-api.service=api@internal"

volumes:
pgadmin_data:
Expand All @@ -224,7 +221,6 @@ volumes:
device: .
o: bind


networks:
custom_network:
driver: bridge
Expand Down

0 comments on commit bf8910d

Please sign in to comment.