mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 12:41:04 +00:00
Project Initialization
This commit is contained in:
126
infrastructure/docker/docker-compose.dev.yml
Normal file
126
infrastructure/docker/docker-compose.dev.yml
Normal file
@@ -0,0 +1,126 @@
|
||||
version: "3.9"
|
||||
|
||||
networks:
|
||||
edr-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres-freight-data:
|
||||
postgres-passenger-data:
|
||||
redis-data:
|
||||
|
||||
services:
|
||||
postgres-freight:
|
||||
image: postgres:17-alpine
|
||||
container_name: edr-postgres-freight
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: edr_freight
|
||||
ports:
|
||||
- "5433:5432"
|
||||
volumes:
|
||||
- postgres-freight-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
postgres-passenger:
|
||||
image: postgres:17-alpine
|
||||
container_name: edr-postgres-passenger
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: edr_passenger
|
||||
ports:
|
||||
- "5434:5432"
|
||||
volumes:
|
||||
- postgres-passenger-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: edr-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-freight-api:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-freight-api/Dockerfile
|
||||
container_name: edr-freight-api
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres-freight
|
||||
- redis
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
PORT: 3001
|
||||
DB_HOST: postgres-freight
|
||||
DB_PORT: 5432
|
||||
DB_NAME: edr_freight
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
ports:
|
||||
- "3001:3001"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-freight-web:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-freight-web/Dockerfile
|
||||
container_name: edr-freight-web
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- edr-freight-api
|
||||
ports:
|
||||
- "5173:5173"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-passenger-api:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-passenger-api/Dockerfile
|
||||
container_name: edr-passenger-api
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres-passenger
|
||||
- redis
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
PORT: 3002
|
||||
DB_HOST: postgres-passenger
|
||||
DB_PORT: 5432
|
||||
DB_NAME: edr_passenger
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
ports:
|
||||
- "3002:3002"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-passenger-web:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-passenger-web/Dockerfile
|
||||
container_name: edr-passenger-web
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- edr-passenger-api
|
||||
ports:
|
||||
- "5174:5174"
|
||||
networks:
|
||||
- edr-network
|
||||
134
infrastructure/docker/docker-compose.prod.yml
Normal file
134
infrastructure/docker/docker-compose.prod.yml
Normal file
@@ -0,0 +1,134 @@
|
||||
version: "3.9"
|
||||
|
||||
networks:
|
||||
edr-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres-freight-data:
|
||||
postgres-passenger-data:
|
||||
redis-data:
|
||||
|
||||
services:
|
||||
postgres-freight:
|
||||
image: postgres:17-alpine
|
||||
container_name: edr-postgres-freight
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_DB: ${DB_NAME_FREIGHT}
|
||||
volumes:
|
||||
- postgres-freight-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
postgres-passenger:
|
||||
image: postgres:17-alpine
|
||||
container_name: edr-postgres-passenger
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_DB: ${DB_NAME_PASSENGER}
|
||||
volumes:
|
||||
- postgres-passenger-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: edr-redis
|
||||
restart: always
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-freight-api:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-freight-api/Dockerfile
|
||||
container_name: edr-freight-api
|
||||
restart: always
|
||||
depends_on:
|
||||
- postgres-freight
|
||||
- redis
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3001
|
||||
DB_HOST: postgres-freight
|
||||
DB_PORT: 5432
|
||||
DB_NAME: ${DB_NAME_FREIGHT}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
REDIS_HOST: redis
|
||||
expose:
|
||||
- "3001"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-freight-web:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-freight-web/Dockerfile
|
||||
container_name: edr-freight-web
|
||||
restart: always
|
||||
depends_on:
|
||||
- edr-freight-api
|
||||
expose:
|
||||
- "5173"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-passenger-api:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-passenger-api/Dockerfile
|
||||
container_name: edr-passenger-api
|
||||
restart: always
|
||||
depends_on:
|
||||
- postgres-passenger
|
||||
- redis
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3002
|
||||
DB_HOST: postgres-passenger
|
||||
DB_PORT: 5432
|
||||
DB_NAME: ${DB_NAME_PASSENGER}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
REDIS_HOST: redis
|
||||
expose:
|
||||
- "3002"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
edr-passenger-web:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: apps/edr-passenger-web/Dockerfile
|
||||
container_name: edr-passenger-web
|
||||
restart: always
|
||||
depends_on:
|
||||
- edr-passenger-api
|
||||
expose:
|
||||
- "5174"
|
||||
networks:
|
||||
- edr-network
|
||||
|
||||
nginx:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: edr-nginx
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- edr-freight-web
|
||||
- edr-freight-api
|
||||
- edr-passenger-web
|
||||
- edr-passenger-api
|
||||
volumes:
|
||||
- ../../infrastructure/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
networks:
|
||||
- edr-network
|
||||
63
infrastructure/nginx/nginx.conf
Normal file
63
infrastructure/nginx/nginx.conf
Normal file
@@ -0,0 +1,63 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
server_tokens off;
|
||||
|
||||
upstream edr_freight_api {
|
||||
server edr-freight-api:3001;
|
||||
}
|
||||
upstream edr_freight_web {
|
||||
server edr-freight-web:5173;
|
||||
}
|
||||
upstream edr_passenger_api {
|
||||
server edr-passenger-api:3002;
|
||||
}
|
||||
upstream edr_passenger_web {
|
||||
server edr-passenger-web:5174;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name freight.edr.local;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://edr_freight_api/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://edr_freight_web/;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name passenger.edr.local;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://edr_passenger_api/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://edr_passenger_web/;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user