2026-07-11 00:17:49 +00:00
|
|
|
services:
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:16-alpine
|
2026-07-10 23:57:50 +00:00
|
|
|
container_name: petmaster-postgres
|
|
|
|
|
restart: unless-stopped
|
2026-07-11 00:17:49 +00:00
|
|
|
environment:
|
|
|
|
|
POSTGRES_DB: petmaster
|
|
|
|
|
POSTGRES_USER: petmaster
|
|
|
|
|
POSTGRES_PASSWORD: petmaster_secret
|
|
|
|
|
ports:
|
|
|
|
|
- "5432:5432"
|
|
|
|
|
volumes:
|
|
|
|
|
- pgdata:/var/lib/postgresql/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U petmaster"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
|
2026-07-10 23:57:50 +00:00
|
|
|
redis:
|
|
|
|
|
image: redis:7-alpine
|
|
|
|
|
container_name: petmaster-redis
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "6379:6379"
|
|
|
|
|
volumes:
|
2026-07-11 00:19:51 +00:00
|
|
|
- redisdata:/data
|
2026-07-10 23:57:50 +00:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
2026-07-11 00:19:51 +00:00
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 10
|
|
|
|
|
start_period: 5s
|
2026-07-10 23:57:50 +00:00
|
|
|
|
2026-07-11 00:17:49 +00:00
|
|
|
api:
|
|
|
|
|
build:
|
|
|
|
|
context: ./api
|
|
|
|
|
dockerfile: Dockerfile
|
2026-07-11 00:19:51 +00:00
|
|
|
target: dev
|
|
|
|
|
container_name: petmaster-api
|
2026-07-10 23:57:50 +00:00
|
|
|
restart: unless-stopped
|
2026-07-11 00:17:49 +00:00
|
|
|
ports:
|
|
|
|
|
- "3000:3000"
|
|
|
|
|
environment:
|
|
|
|
|
DATABASE_URL: postgresql://petmaster:petmaster_secret@postgres:5432/petmaster?schema=public
|
2026-07-11 00:19:51 +00:00
|
|
|
REDIS_URL: redis://redis:6379
|
|
|
|
|
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
|
2026-07-11 00:17:49 +00:00
|
|
|
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY:-sk_test_placeholder}
|
|
|
|
|
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET:-whsec_placeholder}
|
2026-07-11 18:37:34 +00:00
|
|
|
CORS_ORIGIN: "*"
|
2026-07-11 00:17:49 +00:00
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
2026-07-10 23:57:50 +00:00
|
|
|
redis:
|
|
|
|
|
condition: service_healthy
|
2026-07-11 00:17:49 +00:00
|
|
|
volumes:
|
|
|
|
|
- ./api/src:/app/src # hot-reload in dev
|
|
|
|
|
command: >
|
2026-07-11 00:19:51 +00:00
|
|
|
sh -c "npx prisma migrate deploy && npx prisma seed && npm run start:dev"
|
|
|
|
|
networks:
|
|
|
|
|
- petmaster-net
|
2026-07-11 00:17:49 +00:00
|
|
|
|
|
|
|
|
web:
|
|
|
|
|
build:
|
|
|
|
|
context: ./web
|
|
|
|
|
dockerfile: Dockerfile
|
2026-07-11 00:19:51 +00:00
|
|
|
target: dev
|
|
|
|
|
container_name: petmaster-web
|
2026-07-10 23:57:50 +00:00
|
|
|
restart: unless-stopped
|
2026-07-11 00:17:49 +00:00
|
|
|
ports:
|
|
|
|
|
- "3001:3001"
|
|
|
|
|
environment:
|
2026-07-11 18:37:34 +00:00
|
|
|
REACT_APP_API_URL: http://api:3000
|
2026-07-11 00:17:49 +00:00
|
|
|
depends_on:
|
|
|
|
|
- api
|
2026-07-11 00:19:51 +00:00
|
|
|
networks:
|
|
|
|
|
- petmaster-net
|
|
|
|
|
|
2026-07-11 00:17:49 +00:00
|
|
|
volumes:
|
|
|
|
|
pgdata:
|
2026-07-11 00:19:51 +00:00
|
|
|
driver: local
|
|
|
|
|
redisdata:
|
|
|
|
|
driver: local
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
petmaster-net:
|
|
|
|
|
driver: bridge
|