diff --git a/.gitmodules b/.gitmodules index ad695c4..616e515 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "deans-api"] path = deans-api - url = https://github.com/Deans-CMS/deans-api + url = https://github.com/NKSL2001/deans-api.git [submodule "deans-frontend"] path = deans-frontend - url = https://github.com/Deans-CMS/deans-frontend + url = https://github.com/NKSL2001/deans-frontend.git [submodule "deans-notification"] path = deans-notification - url = https://github.com/Deans-CMS/deans-notification.git + url = https://github.com/NKSL2001/deans-notification.git diff --git a/deans-api b/deans-api index dbfa6b6..acd993f 160000 --- a/deans-api +++ b/deans-api @@ -1 +1 @@ -Subproject commit dbfa6b63ddb5b8d401dbd2fa7319d6d22e895d8a +Subproject commit acd993ff25ed1959dd9ef7612d4d5686d008185e diff --git a/deans-frontend b/deans-frontend index ed6cad5..de1ea5e 160000 --- a/deans-frontend +++ b/deans-frontend @@ -1 +1 @@ -Subproject commit ed6cad5cd8fcc2ad1bd74b4a7202d495977cc4ae +Subproject commit de1ea5e91955d5c62a7461e9fb49f99b29746f26 diff --git a/deans-notification b/deans-notification index 5df90db..fe8ce9a 160000 --- a/deans-notification +++ b/deans-notification @@ -1 +1 @@ -Subproject commit 5df90db4b2c5500b6aaae1682e684c8e18a773e7 +Subproject commit fe8ce9aa51f42d5b13e80e571eb13942d96ca02b diff --git a/docker-compose.yaml b/docker-compose.yaml index 912de88..1134174 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,122 +1,121 @@ -version: '3' +version: "3" networks: - nginx_network: - driver: bridge - db_network: - driver: bridge - notification_network: - driver: bridge - redis_network: - driver: bridge - # frontend_network: - # driver: bridge - + nginx_network: + driver: bridge + db_network: + driver: bridge + notification_network: + driver: bridge + redis_network: + driver: bridge + # frontend_network: + # driver: bridge services: - db: - image: postgres - ports: - - "5432:5432" - env_file: - - default.env - networks: - - db_network - redis: - image: redis:2.8 - command: redis-server - ports: - - "6379:6379" - networks: - - redis_network - web: - build: - context: ./deans-api - image: django_image - entrypoint: "start_django.sh" - env_file: - - default.env - volumes: - - ./deans-api/data:/data - - ./deans-api/deans_api:/work/deans-api/deans_api - - static_volume:/static-django - depends_on: - - db - - redis - networks: - - db_network - - nginx_network - - notification_network - - redis_network - notification: - build: - context: ./deans-notification - image: notification_image - entrypoint: "start_server.sh" - # command: "python -c \"while True: pass\"" - # ports: - # - "8000:3000" - env_file: - - default.env - volumes: - - ./deans-notification:/work - networks: - - notification_network - # frontend: - # build: - # context: ./deans-frontend - # image: frontend_image - # networks: - # - frontend_network - # ports: - # - 3000:3000 - nginx: - build: - context: ./nginx - image: nginx:1.13 - ports: - - 8000:80 - volumes: - - ./nginx/conf.d:/etc/nginx/conf.d - - static_volume:/static-django - env_file: - - default.env - depends_on: - - web - # - frontend - # - node - networks: - - nginx_network - cron: - image: django_image - command: bash -c "python3 /cron/cron.py" - env_file: - - default.env - volumes: - - ./cron:/cron - - ./deans-api/deans_api:/work/deans-api/deans_api - depends_on: - - web - networks: - - notification_network - - db_network - -volumes: - static_volume: + db: + image: postgres:17 + ports: + - "5432:5432" + env_file: + - default.env + networks: + - db_network + volumes: + - database_volume:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: password + adminer: + image: adminer + restart: always + ports: + - 8080:8080 + networks: + - db_network + redis: + image: redis:2.8 + command: redis-server + ports: + - "6379:6379" + networks: + - redis_network + web: + build: + context: ./deans-api + entrypoint: "start_django.sh" + env_file: + - default.env + volumes: + - ./deans-api/data:/data + - ./deans-api/deans_api:/work/deans-api/deans_api + - static_volume:/static-django + depends_on: + - db + # - redis + networks: + - db_network + - nginx_network + - notification_network + - redis_network + # notification: + # build: + # context: ./deans-notification + # entrypoint: "start_server.sh" + # # command: "python -c \"while True: pass\"" + # # ports: + # # - "8000:3000" + # env_file: + # - default.env + # volumes: + # - ./deans-notification:/work + # networks: + # - notification_network + frontend: + build: ./deans-frontend + ports: + - "3000:3000" + expose: + - 3000 + volumes: + - ./deans-frontend:/work/ + command: bash -c "yarn install; yarn start" + networks: + # - frontend_network + - nginx_network + nginx: + build: + context: ./nginx + image: nginx:1.13 + ports: + - 8000:80 + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d + - static_volume:/static-django + env_file: + - default.env + depends_on: + - web + # - frontend + # - node + networks: + - nginx_network + # cron: + # image: python:3.6 + # command: bash -c "python3 /cron/cron.py" + # env_file: + # - default.env + # volumes: + # - ./cron:/cron + # - ./deans-api/deans_api:/work/deans-api/deans_api + # depends_on: + # - web + # networks: + # - notification_network + # - db_network - # node: - # build: ./deans-frontend - # ports: - # - "3000:3000" - # expose: - # - 3000 - # volumes: - # - ./deans-frontend:/work/ - # ports: - # - "3000" - # command: bash -c "yarn install; yarn start" - # networks: - # - nginx_network \ No newline at end of file +volumes: + static_volume: + database_volume: diff --git a/nginx/conf.d/local.conf b/nginx/conf.d/local.conf index bca87ea..3e9e434 100644 --- a/nginx/conf.d/local.conf +++ b/nginx/conf.d/local.conf @@ -15,7 +15,7 @@ server { server_name localhost; location /api/ { - proxy_pass http://api_server; + proxy_pass http://web:8000; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme;