servico_plugnotas_teste/docker-compose.yml
2026-07-10 16:32:22 -03:00

111 lines
2.6 KiB
YAML

services:
redis:
image: redis
command: redis-server --save 300 1
restart: always
volumes:
- ./redis-data:/data
banco:
image: postgres:15
command: postgres -c listen_addresses='*'
restart: always
env_file: .env
environment:
POSTGRES_DB: ${POSTGRES_DB:-tecnospeed}
POSTGRES_USER: ${POSTGRES_USER:-tecnospeed}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tecnospeed}
volumes:
- ./postgres-data:/var/lib/postgresql/data
ports:
- "15432:5432"
tecnospeed_rpc:
build: ./tecnospeed_rpc
image: servico_plugnotas-tecnospeed_rpc:v2
command: python tecnospeed_rpc.py
restart: always
env_file: .env
environment:
- "TZ=America/Sao_Paulo"
- "REDIS_HOST=redis"
- "PLUGNOTAS_URL=https://api.sandbox.plugnotas.com.br"
- "LISTENER_INTERNAL_URL=http://endpoint_listener:8000/listenerPlugnotas"
volumes:
- ./tecnospeed_rpc/src:/app
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
shm_size: "500m"
deploy:
resources:
limits:
cpus: "1"
memory: "500m"
depends_on:
- redis
- banco
tecnospeed_queue:
build: ./tecnospeed_queue
image: servico_plugnotas-tecnospeed_queue:v2
command: python tecnospeed_queue.py
restart: always
env_file: .env
environment:
- "TZ=America/Sao_Paulo"
- "REDIS_HOST=redis"
- "PLUGNOTAS_URL=https://api.sandbox.plugnotas.com.br"
- "LISTENER_INTERNAL_URL=http://endpoint_listener:8000/listenerPlugnotas"
volumes:
- ./tecnospeed_queue/src:/app
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
shm_size: "500m"
deploy:
resources:
limits:
cpus: "1"
memory: "500m"
networks:
- default
depends_on:
- redis
- banco
endpoint_listener:
build: ./endpoint_listener
image: servico_plugnotas-endpoint_listener:v2
command: python endpoint_listener.py
restart: always
environment:
- "TZ=America/Sao_Paulo"
- "REDIS_HOST=redis"
- "WEBHOOK_PORT=8000"
ports:
- "8000:8000"
volumes:
- ./endpoint_listener/src:/app
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "10k"
max-file: "3"
depends_on:
- redis
shm_size: "200m"
networks:
default:
name: servico_plugnotas_default