Refactor Docker entrypoints and remove unused scripts
- Removed custom entrypoint scripts for backend, frontend, and PostgreSQL services from docker-compose files. - Added a new entrypoint script in the backend and frontend Dockerfiles to handle initialization without relying on host-mounted scripts. - Updated Dockerfiles to ensure proper permissions for the new entrypoint scripts. - Enhanced database initialization logic by moving schema and extension creation to the Alembic migration script.
This commit is contained in:
@@ -12,7 +12,6 @@ services:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_app_data:/var/lib/postgresql
|
||||
- ./scripts/postgres-app-entrypoint.sh:/docker-entrypoint-initdb.d/init-app.sh:ro
|
||||
networks:
|
||||
- backend-net
|
||||
restart: unless-stopped
|
||||
@@ -48,7 +47,6 @@ services:
|
||||
- "5433:5432"
|
||||
volumes:
|
||||
- postgres_keycloak_data:/var/lib/postgresql
|
||||
- ./scripts/postgres-keycloak-entrypoint.sh:/docker-entrypoint-initdb.d/init-keycloak.sh:ro
|
||||
networks:
|
||||
- auth-net
|
||||
- backend-net
|
||||
@@ -206,12 +204,10 @@ services:
|
||||
- ./backend:/app
|
||||
- backend_cache:/app/__pycache__
|
||||
- backend_uploads:/app/uploads
|
||||
- ./scripts/backend-entrypoint.sh:/entrypoint.sh:ro
|
||||
networks:
|
||||
- backend-net
|
||||
- frontend-net
|
||||
restart: unless-stopped
|
||||
entrypoint: [ "/entrypoint.sh" ]
|
||||
command: [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--log-level", "info" ]
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1" ]
|
||||
@@ -257,11 +253,9 @@ services:
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
entrypoint: [ "/frontend-entrypoint.sh" ]
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- frontend_node_modules:/app/node_modules
|
||||
- ./scripts/frontend-entrypoint.sh:/frontend-entrypoint.sh:ro
|
||||
networks:
|
||||
- frontend-net
|
||||
- auth-net
|
||||
|
||||
Reference in New Issue
Block a user