feat: initialize microservice architecture with auth, api, realtime, copernicus, ml, and console modules
This commit is contained in:
164
docker-compose.yml
Normal file
164
docker-compose.yml
Normal file
@@ -0,0 +1,164 @@
|
||||
services:
|
||||
auth:
|
||||
container_name: auth
|
||||
build:
|
||||
context: ./auth
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
command: npm run dev
|
||||
volumes:
|
||||
- ./auth:/app
|
||||
- /app/node_modules
|
||||
env_file:
|
||||
- ./auth/.env
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "fetch('http://localhost:3006/health').then(r => r.ok ? process.exit(0) : process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- meb-proxy-net
|
||||
- meb-internal
|
||||
ports:
|
||||
- "3006:3006"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.auth.rule=Host(`auth.${URL_DOMAIN}`)"
|
||||
- "traefik.http.routers.auth.entrypoints=web"
|
||||
- "traefik.http.services.auth.loadbalancer.server.port=3006"
|
||||
- "traefik.docker.network=meb-proxy-net"
|
||||
|
||||
api:
|
||||
container_name: api-services
|
||||
build:
|
||||
context: ./api
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
command: npm run dev
|
||||
volumes:
|
||||
- ./api/src:/app/src
|
||||
- /app/node_modules
|
||||
- ./ml:/ml-source
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
env_file:
|
||||
- ./api/.env
|
||||
networks:
|
||||
- meb-proxy-net
|
||||
- meb-internal
|
||||
ports:
|
||||
- "3003:3003"
|
||||
|
||||
console:
|
||||
build:
|
||||
context: ./console
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
command: npm run dev
|
||||
volumes:
|
||||
- ./console:/app
|
||||
- /app/node_modules
|
||||
env_file:
|
||||
- ./console/.env
|
||||
networks:
|
||||
- meb-proxy-net
|
||||
- meb-internal
|
||||
ports:
|
||||
- "3004:3004"
|
||||
|
||||
realtime:
|
||||
build:
|
||||
context: ./realtime
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
command: npm run dev
|
||||
ports:
|
||||
- "3002:3002"
|
||||
- "3102:3102"
|
||||
volumes:
|
||||
- ./realtime:/app
|
||||
- /app/node_modules
|
||||
env_file:
|
||||
- ./realtime/.env
|
||||
networks:
|
||||
- meb-proxy-net
|
||||
- meb-internal
|
||||
|
||||
# ml:
|
||||
# container_name: ml-service
|
||||
# build:
|
||||
# context: ./ml
|
||||
# dockerfile: Dockerfile
|
||||
# restart: unless-stopped
|
||||
# volumes:
|
||||
# - ./ml:/app
|
||||
# env_file:
|
||||
# - ./ml/.env
|
||||
# ports:
|
||||
# - "3005:3005"
|
||||
# networks:
|
||||
# - meb-proxy-net
|
||||
# - meb-internal
|
||||
|
||||
# marine:
|
||||
# container_name: marine-service
|
||||
# build:
|
||||
# context: ./marine
|
||||
# dockerfile: Dockerfile
|
||||
# restart: unless-stopped
|
||||
# volumes:
|
||||
# - ./marine:/app
|
||||
# env_file:
|
||||
# - ./marine/.env
|
||||
# environment:
|
||||
# - REDIS_HOST=meb-redis
|
||||
# - REDIS_PORT=6379
|
||||
# networks:
|
||||
# - meb-proxy-net
|
||||
# - meb-internal
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.marine.rule=Host(`api.${URL_DOMAIN}`) && PathPrefix(`/marine`)"
|
||||
# - "traefik.http.routers.marine.entrypoints=web"
|
||||
# - "traefik.http.services.marine.loadbalancer.server.port=8001"
|
||||
# - "traefik.docker.network=meb-proxy-net"
|
||||
# - "traefik.http.middlewares.marine-strip.stripprefix.prefixes=/marine"
|
||||
# - "traefik.http.routers.marine.middlewares=marine-strip"
|
||||
|
||||
# circuits:
|
||||
# container_name: meb-circuits
|
||||
# build:
|
||||
# context: ./circuits
|
||||
# dockerfile: Dockerfile
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# - DATABASE_URL=postgresql://meb:meb@meb-postgres:5432/circuits
|
||||
# - AUTH_SERVICE_URL=http://auth:3001
|
||||
# - AUTH_URL=http://auth.${URL_DOMAIN:-localhost}
|
||||
# - API_URL=http://api.${URL_DOMAIN:-localhost}
|
||||
# - NODE_ENV=${NODE_ENV:-development}
|
||||
# volumes:
|
||||
# - ./circuits/src:/app/src
|
||||
# - /app/node_modules
|
||||
# healthcheck:
|
||||
# test: ["CMD", "node", "-e", "fetch('http://localhost:3005/health').then(r => r.ok ? process.exit(0) : process.exit(1))"]
|
||||
# interval: 30s
|
||||
# timeout: 5s
|
||||
# retries: 3
|
||||
# depends_on:
|
||||
# - auth
|
||||
# networks:
|
||||
# - meb-proxy-net
|
||||
# - meb-internal
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.circuits.rule=Host(`circuits.${URL_DOMAIN}`)"
|
||||
# - "traefik.http.routers.circuits.entrypoints=web"
|
||||
# - "traefik.http.services.circuits.loadbalancer.server.port=3005"
|
||||
# - "traefik.docker.network=meb-proxy-net"
|
||||
# - "traefik.http.routers.circuits.middlewares=cors-ignore"
|
||||
|
||||
networks:
|
||||
meb-proxy-net:
|
||||
external: true
|
||||
meb-internal:
|
||||
external: true
|
||||
Reference in New Issue
Block a user