mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
Add docker-compose configuration for ids-svc-product microservice, defining service settings, environment variables, health checks, and volume mappings for development and deployment.
This commit is contained in:
parent
8bb1aad6ea
commit
ab6c8f08be
48
docker-compose.yaml
Normal file
48
docker-compose.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
services:
|
||||
ids-svc-product:
|
||||
image: golang:${GO_TAG:-1.26.4-alpine}
|
||||
container_name: ids-svc-product
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
working_dir: /workspace/ids-svc-product
|
||||
command: ["sh", "-c", "go mod download && go run ./cmd"]
|
||||
environment:
|
||||
SERVER_PORT: ":50052"
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_PORT: "5432"
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres@pass}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-ids_ecommerce}
|
||||
POSTGRES_SCHEMA: ${POSTGRES_SCHEMA:-product_schema}
|
||||
POSTGRES_SSLMODE: ${POSTGRES_SSLMODE:-disable}
|
||||
NATS_URL: nats://nats:4222
|
||||
GOMODCACHE: /go/pkg/mod
|
||||
GOCACHE: /root/.cache/go-build
|
||||
ports:
|
||||
- "${PRODUCT_GRPC_PORT:-50052}:50052"
|
||||
volumes:
|
||||
- .:/workspace/ids-svc-product
|
||||
- ../ids-proto:/workspace/ids-proto:ro
|
||||
- product_go_mod_cache:/go/pkg/mod
|
||||
- product_go_build_cache:/root/.cache/go-build
|
||||
networks:
|
||||
- ids-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nc -z 127.0.0.1 50052"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
start_period: 30s
|
||||
labels:
|
||||
stack: ids-ecommerce
|
||||
tier: service
|
||||
service: product
|
||||
|
||||
networks:
|
||||
ids-net:
|
||||
name: ids-ecommerce
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
product_go_mod_cache:
|
||||
product_go_build_cache:
|
||||
Loading…
Reference in New Issue
Block a user