datewise/docker-compose.yml
metatroncubeswdev 54734e8938 feat(billing): switch to Shopify managed pricing; show chosen time on thank-you page
App Store review 1.2.2 ("fails to register the plan"): follow Offerlyst's approved
managed-pricing setup. The plan is read from the Partner API on every app load,
shops without a plan (new install or reinstall) go to Shopify's plan selection
page, and app_subscriptions/update keeps it in sync. Billing API code removed.

Reviewer's checkout video: Shopify's checkout shows pickup by location name, so
the delivery label rename never reached the shopper. New checkout-time extension
shows the chosen date and time on the thank-you page (all plans) and next to
pickup/shipping options (Plus). Checkout display copy now matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:52:00 -05:00

81 lines
2.8 KiB
YAML

# Production stack for one VPS: Postgres + the app + the worker + Caddy (automatic HTTPS from Let's Encrypt).
# Usage: cp .env.example .env (fill in the production section) then docker compose up -d --build
# If the VPS already runs Nginx on 80/443, use docker-compose.nginx.yml instead of Caddy (see that file).
x-app-env: &app-env
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://datewise:${POSTGRES_PASSWORD}@db:5432/datewise?schema=public
SHOPIFY_API_KEY: ${SHOPIFY_API_KEY:?set SHOPIFY_API_KEY in .env}
SHOPIFY_API_SECRET: ${SHOPIFY_API_SECRET:?set SHOPIFY_API_SECRET in .env}
SHOPIFY_APP_URL: https://${APP_DOMAIN:?set APP_DOMAIN in .env}
SCOPES: read_products,write_products,write_publications,read_orders,write_orders,read_customers,read_locations,read_inventory,write_validations,write_delivery_customizations,write_payment_customizations
APP_ENCRYPTION_KEY: ${APP_ENCRYPTION_KEY:?set APP_ENCRYPTION_KEY in .env (openssl rand -base64 32)}
GOOGLE_MAPS_API_KEY: ${GOOGLE_MAPS_API_KEY:-}
RESEND_API_KEY: ${RESEND_API_KEY:-}
EMAIL_FROM_DOMAIN: ${EMAIL_FROM_DOMAIN:-}
# Managed pricing: the shop's plan is read from the Partner API
SHOPIFY_APP_HANDLE: ${SHOPIFY_APP_HANDLE:-datewise-delivery}
SHOPIFY_PARTNER_ORG_ID: ${SHOPIFY_PARTNER_ORG_ID:-}
SHOPIFY_PARTNER_API_ACCESS_TOKEN: ${SHOPIFY_PARTNER_API_ACCESS_TOKEN:-}
SHOPIFY_APP_GID: ${SHOPIFY_APP_GID:-}
services:
db:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: datewise
POSTGRES_USER: datewise
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U datewise -d datewise"]
interval: 5s
retries: 10
app:
build: .
image: datewise:latest
pull_policy: build
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment: *app-env
expose:
- "3000"
# Sweeps expired holds, sends reminders, offers freed places to the waitlist, reconciles missed orders.
worker:
build: . # same Dockerfile; the build cache makes this free after the app's build
image: datewise:latest
pull_policy: build # never look for "datewise" on Docker Hub
restart: unless-stopped
depends_on:
app:
condition: service_healthy # the app has applied migrations
environment: *app-env
command: ["node", "build/worker.mjs"]
healthcheck:
disable: true
caddy:
image: caddy:2-alpine
restart: unless-stopped
depends_on: [app]
ports:
- "80:80"
- "443:443"
environment:
APP_DOMAIN: ${APP_DOMAIN}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
volumes:
pgdata:
caddy_data:
caddy_config: