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:
2026-04-24 12:53:11 -05:00
parent e1d07ba460
commit 9d63b000bc
12 changed files with 102 additions and 173 deletions

View File

@@ -12,7 +12,6 @@ services:
- "5939:5432"
volumes:
- postgres_app_data:/var/lib/postgresql/data
- ./scripts/postgres-app-entrypoint.sh:/docker-entrypoint-initdb.d/init-app.sh:ro
networks:
- backend-net
restart: unless-stopped
@@ -48,7 +47,6 @@ services:
- "5233:5432"
volumes:
- postgres_keycloak_data:/var/lib/postgresql/data
- ./scripts/postgres-keycloak-entrypoint.sh:/docker-entrypoint-initdb.d/init-keycloak.sh:ro
networks:
- auth-net
- backend-net
@@ -201,12 +199,10 @@ services:
volumes:
- backend_uploads:/app/uploads
- backend_layouts:/app/layouts
- ./scripts/backend-entrypoint.sh:/entrypoint.sh:ro
networks:
- backend-net
- frontend-net
restart: unless-stopped
entrypoint: [ "/entrypoint.sh" ]
command: [ "gunicorn", "main:app", "-k", "uvicorn.workers.UvicornWorker", "-w", "${WEB_CONCURRENCY:-1}", "-b", "0.0.0.0:8000", "--log-level", "info", "--forwarded-allow-ips", "*" ]
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1" ]
@@ -354,9 +350,6 @@ services:
depends_on:
backend:
condition: service_healthy
entrypoint: [ "/frontend-entrypoint.sh" ]
volumes:
- ./scripts/frontend-entrypoint.sh:/frontend-entrypoint.sh:ro
networks:
- frontend-net
- backend-net