Skip to content

Commit f741302

Browse files
committed
Fixed addresses in Nginx and added more description.
1 parent 09ff08a commit f741302

File tree

6 files changed

+57
-13
lines changed

6 files changed

+57
-13
lines changed

README.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,53 @@
11
# delivery-service
22
>Сервис поиска ближайших машин для перевозки грузов.
3+
<img src="docs/images/main_page.jpg" width=800>
4+
5+
---
36
### Установка
4-
В корневой директории выполните команду
7+
В корневой директории выполните команду:
58
```sh
6-
docker compose up -v --built
9+
docker compose up -d --built
710
```
811

912
### Просмотр
10-
Перейдите по адресу `0.0.0.0:8083/` для просмотра карты с грузами и машинами или `0.0.0.0:8001/docs/` для работы с API сервиса.
13+
Перейдите по адресу `0.0.0.0:8083` для просмотра карты с грузами и машинами или `0.0.0.0:8001` для работы с API сервиса.
14+
15+
### Архитектура
16+
```mermaid
17+
flowchart LR
18+
subgraph server [Server]
19+
direction TB
20+
21+
subgraph db [Databases]
22+
direction TB
23+
db1[(PostGis)]
24+
end
25+
db1 <--> b1
26+
subgraph b1 [Backend]
27+
direction LR
28+
b2[[Cars API]]
29+
b3[[Cargo API]]
30+
end
31+
32+
ng{{Nginx}} <--> b1
33+
react[[ReactJS]]
34+
ng <-- GraphQL --> react
35+
end
36+
37+
subgraph cls [Clients]
38+
direction LR
39+
cl1([Client 1])
40+
cl2([Client 2])
41+
end
42+
react <-. WEB .-> cls
43+
ng <-. REST API .-> cls
44+
```
45+
Сервис разделен на три части:
46+
- База данных PostGis
47+
- Backend на FastAPI
48+
- Frontend на ReactJS
49+
50+
### License
51+
Copyright © 2023 [dsuhoi](https://github.com/dsuhoi).
52+
53+
This project is [MIT](https://github.com/dsuhoi/delivery-service/blob/main/LICENSE) licensed.

backend/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ RUN apt-get update && apt-get install -y libpq-dev netcat
66
RUN pip3 install poetry
77

88
COPY . .
9-
# COPY *.py locations.csv pytest.ini poetry.lock pyproject.toml ./
10-
# COPY core/ ./core/
11-
# COPY routers/ ./routers/
12-
# COPY tasks/ ./tasks/
13-
# COPY tests/ ./tests/
149

1510
RUN poetry config virtualenvs.create false \
1611
&& poetry install --no-interaction --no-ansi

docs/images/main_page.jpg

122 KB
Loading

frontend/.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
**/node_modules/

frontend/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ WORKDIR /frontend_app
44

55
ENV PATH /app/node_modules/.bin:$PATH
66

7-
COPY package.json package-lock.json ./
8-
COPY src/ ./src/
9-
COPY public/ ./public/
7+
COPY . .
108

119
RUN npm install
1210

nginx/nginx.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ http {
1010
gzip_disable "MSIE [1-6]\.";
1111

1212
upstream frontend {
13-
server frontend:3001;
13+
server frontend:3000;
1414
}
1515

1616
upstream backend {
17-
server backend:8001;
17+
server backend:8000;
1818
}
1919

2020
server {
@@ -27,6 +27,9 @@ http {
2727
location /api {
2828
rewrite /api/(.*) /$1 break;
2929
proxy_pass http://backend;
30+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31+
proxy_set_header Host $http_host;
32+
proxy_http_version 1.1;
3033
}
3134
}
3235
}

0 commit comments

Comments
 (0)