You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Timofey Malinin 75cf1bca39
Update README.md
2 years ago
deploy Feature/cicd 3 years ago
dist hide category image 2 years ago
nginx update nginx config 3 years ago
public hide category image 2 years ago
src Dev to main 2 years ago
.dockerignore Add .env to dockerignore 3 years ago
.env Dev to main 2 years ago
.env.local.example Get api url from env 3 years ago
.gitignore Update build 3 years ago
.gitlab-ci.yml Update .gitlab-ci.yml 2 years ago
Dockerfile Dev to main 2 years ago
README.md Update README.md 2 years ago
docker-compose.yml change deploy 3 years ago
index.html hide category image 2 years ago
package.json hide category image 2 years ago
postcss.config.cjs Add Sidebar with main components 3 years ago
tailwind.config.cjs Add minor markup changes 3 years ago
tsconfig.json Refactor stores; assemble filters store 3 years ago
tsconfig.node.json Refactor stores; assemble filters store 3 years ago
vite-env.d.ts Refactor stores; assemble filters store 3 years ago
vite.config.ts Dev to main 2 years ago
yarn.lock Update id field according to new api version 3 years ago

README.md

Рекомендательный сервис для размещения постаматов

Инструкция по развёртыванию frontend части проекта:

  • Установите docker

  • Установите docker compose

  • Положите файлы из репозитория в папку postamates_frontend:

    • через GIT:
    git clone git@gitlab.com:leaders2022/postamates_frontend.git postamates
    git pull
    git checkout sst_main
    git pull
    
    • через zip архив: unzip archieve.zip -d postamates_frontend
  • создайте файл postamates_frontend/.env на основе файла postamates_frontend/.env.like

  • Запустите проект:

    cd postamates
    sudo docker-compose up -d
    

    после этого статика проекта будет находиться в директории postamates_frontend/dist

Инструкция по devops части проекта:

  • Установите backend

  • Установите frontend

  • Настройте nginx в зависимости от конфигураций .env файлов в backend и frontend репозиториях

  • Пример конфигурации:

	server_name postnet-dev.selftech.ru;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/postnet-dev.selftech.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/postnet-dev.selftech.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

	root /home/postamates_frontend/dist;

	index index.html;
    client_max_body_size 400m;
    location / {
        try_files $uri /index.html;
    }


    location /api/ {
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://0.0.0.0:DJANGO_PORT/api/;
	}
    location /admin/ {
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://0.0.0.0:DJANGO_PORT/admin/;
	}
    location /accounts/ {
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://0.0.0.0:DJANGO_PORT/accounts/;
	}
    location /media  {
        alias /home/postamates/media;
    }

    location /django_static {
        alias /home/postamates/django_static;
    }

    location /martin {
    	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://0.0.0.0:MARTIN_PORT/;
    }

    error_page  500 502 503 504 /50x.html;

    location = /50x.html {
        root  /usr/share/nginx/html;
    }
}
server {
    server_name postnet-dev.selftech.ru;
    if ($host = postnet-dev.selftech.ru) {
        return 301 https://$host$request_uri;
    }
	listen 80 ;
	listen [::]:80 ;
    return 404;
}