Make compose stack Portainer compatible
This commit is contained in:
@@ -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:
|
Build and run the worker once:
|
||||||
|
|
||||||
```sh
|
```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
|
## Gitea Actions + Portainer
|
||||||
|
|
||||||
|
|||||||
14
docker-compose.local-db.yml
Normal file
14
docker-compose.local-db.yml
Normal 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:
|
||||||
@@ -1,27 +1,26 @@
|
|||||||
services:
|
services:
|
||||||
production-orders-sync:
|
production-orders-sync:
|
||||||
build: .
|
image: ${PRODUCTION_ORDERS_SYNC_IMAGE:-gitea.blyzer.com.br/blyzer/production-order-tiny:latest}
|
||||||
container_name: production-orders-sync
|
container_name: production-orders-sync
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
environment:
|
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_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}
|
DRY_RUN: ${DRY_RUN:-false}
|
||||||
restart: "no"
|
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:
|
|
||||||
|
|||||||
Reference in New Issue
Block a user