From da106e6695867564c0aa9f8dfacf6d5e6b3c0292 Mon Sep 17 00:00:00 2001 From: joelson Date: Wed, 7 Jan 2026 19:08:25 -0300 Subject: [PATCH] feat: Update Docker Compose configuration for API service with registry image, environment variables, and resource limits --- docker-compose.yml | 33 +++++++++++++++------------------ src/main.ts | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 060a7b7..e07d6b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,26 +2,19 @@ version: '3.8' services: api: - build: - context: . - dockerfile: Dockerfile - target: production - image: api-controle-saida-loja:latest - container_name: api-controle-saida-loja - restart: unless-stopped + # No Swarm, a imagem já deve estar no registry (10.1.1.124:8082) + image: 10.1.1.124:8082/library/controle-saida-loja-api:latest ports: - "3001:3001" environment: NODE_ENV: production PORT: 3001 - - ORACLE_USER: ${ORACLE_USER} - ORACLE_PASSWORD: ${ORACLE_PASSWORD} - ORACLE_CONNECTION_STRING: ${ORACLE_CONNECTION_STRING} + ORACLE_USER: SEVEN + ORACLE_PASSWORD: usr54sev + ORACLE_CONNECTION_STRING: 10.1.1.241:1521/WINT ORACLE_LIB_DIR: /opt/oracle/instantclient - - JWT_SECRET: ${JWT_SECRET} - + JWT_SECRET: 'Jurunense@Athentic@User' + env_file: - .env @@ -33,13 +26,17 @@ services: start_period: 40s deploy: + mode: replicated + replicas: 4 + restart_policy: + condition: on-failure resources: limits: - cpus: '1' + cpus: '0.30' memory: 512M reservations: - cpus: '0.5' - memory: 256M + cpus: '0.10' + memory: 128M logging: driver: "json-file" @@ -52,4 +49,4 @@ services: networks: api-network: - driver: bridge + driver: overlay \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 46ab755..ba90d05 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,7 +23,7 @@ async function bootstrap() { // Configuração do Swagger const config = new DocumentBuilder() .setTitle('Controle Saída Loja API') - .setDescription('API para controle de saída de loja com autenticação JWT') + .setDescription('API para controle de saída de loja com autenticação JWTWWWWWWWW') .setVersion('1.0') .addTag('auth', 'Endpoints de autenticação') .addTag('user', 'Endpoints de usuário')