oktopus/deploy/compose/docker-compose.yaml
2024-02-27 21:29:41 -03:00

112 lines
2.4 KiB
YAML

services:
controller:
image: 'golang:1.21.4'
container_name: controlller
tty: true
stdin_open: true
volumes:
- ../:/app/oktopus
command: bash -c "cd /app/oktopus/backend/services/controller && go run cmd/oktopus/main.go -mongo mongodb://172.16.235.2:27017 -a 172.16.235.4 -p 1883 -ws_addr 172.16.235.8"
ports:
- 8000:8000
depends_on:
- mongodb
- mqtt
- websockets
networks:
usp_network:
ipv4_address: 172.16.235.7
nats:
image: 'nats:latest'
container_name: nats
ports:
- 4222:4222
- 8222:8222
command: -n oktopus -m 8222 -js
networks:
usp_network:
ipv4_address: 172.16.235.9
mongodb:
image: mongo
container_name: mongodb_usp
networks:
usp_network:
ipv4_address: 172.16.235.2
redis:
image: redis
container_name: redis_usp
networks:
usp_network:
ipv4_address: 172.16.235.3
mqtt:
image: 'golang:1.21.4'
container_name: mqtt
tty: true
stdin_open: true
volumes:
- ../:/app/oktopus
command: bash -c "cd /app/oktopus/backend/services/mqtt/cmd/ && go run main.go -redis 'redis:6379' -info :8081"
ports:
- 1883:1883
depends_on:
- redis
networks:
usp_network:
ipv4_address: 172.16.235.4
websockets:
image: 'golang:1.21.6'
container_name: websockets
tty: true
stdin_open: true
volumes:
- ../:/app/oktopus
command: bash -c "cd /app/oktopus/backend/services/ws/ && go run cmd/main.go"
ports:
- 8080:8080
networks:
usp_network:
ipv4_address: 172.16.235.8
socketio:
image: 'node:16.20.2'
container_name: socketio
tty: true
stdin_open: true
volumes:
- ../:/app/oktopus
command: bash -c "cd /app/oktopus/backend/services/socketio/ && npm i && node server.js"
ports:
- 5000:5000
networks:
usp_network:
ipv4_address: 172.16.235.5
frontend:
image: 'node:16.20.2'
container_name: frontend
tty: true
stdin_open: true
volumes:
- ../:/app/oktopus
command: bash -c "cd /app/oktopus/frontend && npm i && npm run dev"
ports:
- 3000:3000
networks:
usp_network:
ipv4_address: 172.16.235.6
networks:
usp_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.235.0/24
gateway: 172.16.235.1