mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
docker compose changes
This commit is contained in:
+31
-35
@@ -1,47 +1,44 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# NEW: Add a dedicated PostgreSQL database service
|
# --- MODIFICATION ---
|
||||||
postgres:
|
# The local postgres service is commented out. Coolify will provide the database.
|
||||||
image: postgres:15-alpine
|
# postgres:
|
||||||
environment:
|
# image: postgres:15-alpine
|
||||||
POSTGRES_USER: ${DB_USER}
|
# environment:
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
# POSTGRES_USER: ${DB_USER}
|
||||||
POSTGRES_DB: ${DB_NAME}
|
# POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
ports:
|
# POSTGRES_DB: ${DB_NAME}
|
||||||
- '${DB_PORT}:5432' # Expose DB port to host machine for local tools
|
# ports:
|
||||||
volumes:
|
# - '${DB_PORT}:5432'
|
||||||
- postgres_data:/var/lib/postgresql/data # Persist data
|
# volumes:
|
||||||
healthcheck:
|
# - postgres_data:/var/lib/postgresql/data
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
# healthcheck:
|
||||||
interval: 10s
|
# test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
||||||
timeout: 5s
|
# interval: 10s
|
||||||
retries: 5
|
# timeout: 5s
|
||||||
networks:
|
# retries: 5
|
||||||
- api.network
|
# networks:
|
||||||
|
# - api.network
|
||||||
|
|
||||||
# MODIFIED: This service now runs migrations and imports against the live Postgres DB
|
# This service will now run against the production database on deploy. Add import-data back into command for data import.
|
||||||
db-init:
|
db-init:
|
||||||
build: .
|
build: .
|
||||||
env_file: .env
|
env_file: .env
|
||||||
command: ["/nba_go", "import-data"]
|
command: ["/nba_go"]
|
||||||
depends_on:
|
# --- MODIFICATION ---
|
||||||
postgres:
|
# depends_on is removed. It will use the DB_HOST from environment variables.
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- api.network
|
- api.network
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
# MODIFIED: All API services now depend on postgres being healthy.
|
|
||||||
# The volume mount for './data' is no longer needed.
|
|
||||||
api1:
|
api1:
|
||||||
build: .
|
build: .
|
||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
- '5001:5000'
|
- '5001:5000'
|
||||||
depends_on:
|
# --- MODIFICATION ---
|
||||||
postgres:
|
# depends_on is removed.
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- api.network
|
- api.network
|
||||||
restart: always
|
restart: always
|
||||||
@@ -51,9 +48,8 @@ services:
|
|||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
- '5002:5000'
|
- '5002:5000'
|
||||||
depends_on:
|
# --- MODIFICATION ---
|
||||||
postgres:
|
# depends_on is removed.
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- api.network
|
- api.network
|
||||||
restart: always
|
restart: always
|
||||||
@@ -63,9 +59,8 @@ services:
|
|||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
- '5003:5000'
|
- '5003:5000'
|
||||||
depends_on:
|
# --- MODIFICATION ---
|
||||||
postgres:
|
# depends_on is removed.
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- api.network
|
- api.network
|
||||||
restart: always
|
restart: always
|
||||||
@@ -115,7 +110,8 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data: # New volume for Postgres
|
# --- MODIFICATION ---
|
||||||
|
# postgres_data volume is no longer needed.
|
||||||
prometheus_data:
|
prometheus_data:
|
||||||
grafana_data:
|
grafana_data:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user