Refactor Docker configuration and API endpoints

- Merged production and development Docker configurations
- Updated Dockerfile to use multi-stage build
- Removed separate Dockerfile.prod
- Modified docker-compose.yml for production settings
- Added new API endpoints for user filtering by ID card
- Updated serializers and views for Atoll and Island management
- Enhanced user and atoll-related filters and views
This commit is contained in:
2025-01-24 11:43:18 +05:00
parent f6f77bb0e5
commit c1fc07e3e2
9 changed files with 118 additions and 137 deletions

View File

@ -1,11 +1,14 @@
services:
api:
build: .
command: python manage.py runserver 0.0.0.0:8000
build:
context: .
dockerfile: Dockerfile.prod
restart: always
command: gunicorn apibase.wsgi:application --bind 0.0.0.0:5000 --workers=2
volumes:
- ./:/usr/src/app/
- /home/<username>/docker/council-api/staticfiles:/home/app/api/staticfiles
ports:
- 8000:8000
- 5000:5000
env_file:
- ./.env
depends_on:
@ -14,17 +17,22 @@ services:
db:
image: postgres:15
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DATABASE}
ports:
- 5232:5432
redis:
image: "redis:alpine"
restart: always
expose:
- "6379"
volumes:
postgres_data: