codedematrix/datacollection
0
1version: "3.9"2 3services:4 db:5 image: postgres:16-alpine6 environment:7 POSTGRES_DB: nca_dc8 POSTGRES_USER: nca9 POSTGRES_PASSWORD: ${DB_PASSWORD}10 volumes:11 - postgres_data:/var/lib/postgresql/data12 restart: always13 healthcheck:14 test: ["CMD-SHELL", "pg_isready -U nca -d nca_dc"]15 interval: 10s16 timeout: 5s17 retries: 518 19 backend:20 build: ./backend21 command: >22 sh -c "python manage.py migrate --noinput &&23 python manage.py collectstatic --noinput &&24 python manage.py loaddata fixtures/ghana_regions.json &&25 gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 4 --timeout 120"26 volumes:27 - media_files:/app/media28 - static_files:/app/staticfiles29 env_file:30 - .env31 environment:32 - DATABASE_URL=postgresql://nca:${DB_PASSWORD}@db:5432/nca_dc33 - DEBUG=False34 depends_on:35 db:36 condition: service_healthy37 restart: always38 39 frontend:40 build:41 context: ./frontend42 target: runner43 environment:44 - NODE_ENV=production45 - NEXT_PUBLIC_API_URL=http://nginx46 restart: always47 48 nginx:49 image: nginx:alpine50 ports:51 - "80:80"52 volumes:53 - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro54 - static_files:/var/www/static:ro55 - media_files:/var/www/media:ro56 depends_on:57 - backend58 - frontend59 restart: always60 61volumes:62 postgres_data:63 static_files:64 media_files:65 