initialize project structure with Docker, Nginx, and environment configuration
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea
|
||||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[submodule "back"]
|
||||||
|
path = back
|
||||||
|
url = https://git.logidex.ru/fakz9/Crm-Backend
|
||||||
|
[submodule "front"]
|
||||||
|
path = front
|
||||||
|
url = https://git.logidex.ru/fakz9/Crm-Frontend
|
||||||
1
back
Submodule
1
back
Submodule
Submodule back added at 453930251b
7
config/back/.env
Normal file
7
config/back/.env
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
PG_LOGIN=
|
||||||
|
PG_PASSWORD=
|
||||||
|
PG_PORT=
|
||||||
|
PG_DATABASE=
|
||||||
|
PG_HOST=
|
||||||
|
|
||||||
|
SECRET_KEY=
|
||||||
0
config/front/.env
Normal file
0
config/front/.env
Normal file
38
config/nginx/nginx.conf
Normal file
38
config/nginx/nginx.conf
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
upstream backned {
|
||||||
|
server unix:/app/run/socket.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream frontend {
|
||||||
|
server front:3000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name crm.logidex.ru;
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
proxy_pass http://backned;
|
||||||
|
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://frontend;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /_next/webpack-hmr {
|
||||||
|
proxy_pass http://frontend;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
|
}
|
||||||
44
docker-compose.yml
Normal file
44
docker-compose.yml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
services:
|
||||||
|
back:
|
||||||
|
image: git.logidex.ru/fakz9/crm-backend:latest
|
||||||
|
volumes:
|
||||||
|
- type: volume
|
||||||
|
source: app_run
|
||||||
|
target: /app/run
|
||||||
|
read_only: false
|
||||||
|
env_file:
|
||||||
|
- config/back/.env
|
||||||
|
restart: unless-stopped
|
||||||
|
front:
|
||||||
|
image: git.logidex.ru/fakz9/crm-frontend:latest
|
||||||
|
depends_on:
|
||||||
|
- back
|
||||||
|
env_file:
|
||||||
|
- config/front/.env
|
||||||
|
networks:
|
||||||
|
- appnet
|
||||||
|
restart: unless-stopped
|
||||||
|
nginx:
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
depends_on:
|
||||||
|
- back
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: ./config/nginx/nginx.conf
|
||||||
|
target: /etc/nginx/conf.d/default.conf
|
||||||
|
read_only: true
|
||||||
|
- type: volume
|
||||||
|
source: app_run
|
||||||
|
target: /app/run
|
||||||
|
read_only: false
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- appnet
|
||||||
|
volumes:
|
||||||
|
app_run:
|
||||||
|
driver: local
|
||||||
|
networks:
|
||||||
|
appnet:
|
||||||
1
front
Submodule
1
front
Submodule
Submodule front added at cd034bcce6
Reference in New Issue
Block a user