Make compose stack Portainer compatible
All checks were successful
production-orders-sync CI/CD / Test (push) Successful in 9m32s
production-orders-sync CI/CD / Build and Push Image (push) Successful in 11s
production-orders-sync CI/CD / Trigger Portainer (push) Successful in 2s

This commit is contained in:
Cauê Faleiros
2026-07-02 15:18:44 -03:00
parent 511add34c8
commit baade0a980
3 changed files with 40 additions and 22 deletions

View File

@@ -101,10 +101,15 @@ Inspect the dry-run logs before enabling writes. Dry-run logs include the Tiny r
Build and run the worker once:
```sh
docker compose run --rm production-orders-sync
docker build -t production-orders-sync:local .
PRODUCTION_ORDERS_SYNC_IMAGE=production-orders-sync:local docker compose run --rm production-orders-sync
```
The included `postgres` service is only a local example. In normal deployment, set `DATABASE_URL` to the existing Graphs Postgres database.
The optional local Postgres example is in `docker-compose.local-db.yml`. In normal deployment, set `DATABASE_URL` to the existing Graphs Postgres database.
```sh
docker compose -f docker-compose.local-db.yml up -d postgres
```
## Gitea Actions + Portainer

View File

@@ -0,0 +1,14 @@
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: graphs
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- production-orders-sync-postgres:/var/lib/postgresql/data
volumes:
production-orders-sync-postgres:

View File

@@ -1,27 +1,26 @@
services:
production-orders-sync:
build: .
image: ${PRODUCTION_ORDERS_SYNC_IMAGE:-gitea.blyzer.com.br/blyzer/production-order-tiny:latest}
container_name: production-orders-sync
env_file:
- .env
environment:
NODE_ENV: production
TINY_API_TOKEN: ${TINY_API_TOKEN:-}
DATABASE_URL: ${DATABASE_URL:-}
TINY_API_BASE_URL: ${TINY_API_BASE_URL:-https://api.tiny.com.br/api2}
TINY_LIST_ENDPOINT: ${TINY_LIST_ENDPOINT:-ordens.producao.pesquisa.php}
TINY_DETAIL_ENDPOINT: ${TINY_DETAIL_ENDPOINT:-ordem.producao.obter.php}
TINY_HTTP_METHOD: ${TINY_HTTP_METHOD:-POST}
TINY_START_DATE_PARAM: ${TINY_START_DATE_PARAM:-dataInicial}
TINY_END_DATE_PARAM: ${TINY_END_DATE_PARAM:-dataFinal}
TINY_DATE_FORMAT: ${TINY_DATE_FORMAT:-DD/MM/YYYY}
TINY_FETCH_DETAILS: ${TINY_FETCH_DETAILS:-false}
TINY_REQUEST_DELAY_MS: ${TINY_REQUEST_DELAY_MS:-5000}
TINY_BLOCK_RETRY_MS: ${TINY_BLOCK_RETRY_MS:-60000}
TINY_MAX_RETRIES: ${TINY_MAX_RETRIES:-3}
SYNC_MODE: ${SYNC_MODE:-backfill}
SYNC_TIME_ZONE: ${SYNC_TIME_ZONE:-America/Sao_Paulo}
RECENT_SYNC_DAYS: ${RECENT_SYNC_DAYS:-2}
SYNC_START_DATE: ${SYNC_START_DATE:-}
SYNC_END_DATE: ${SYNC_END_DATE:-}
DRY_RUN: ${DRY_RUN:-false}
restart: "no"
# Example only. In production, point DATABASE_URL at the existing Graphs Postgres.
postgres:
image: postgres:16-alpine
profiles:
- local-db
environment:
POSTGRES_DB: graphs
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- production-orders-sync-postgres:/var/lib/postgresql/data
volumes:
production-orders-sync-postgres: