@hyphacommerce/cli 0.0.0-stage → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,143 @@
1
+ # Hypha on one server, written by `hypha init` and run by `hypha deploy`. Everything
2
+ # it needs to know is in `.env` next to it (secrets included: keep this folder
3
+ # private). Caddy is the only thing reachable from outside: it gets the certificates
4
+ # and sends each domain to its service.
5
+ #
6
+ # docker compose ps # what's running
7
+ # docker compose logs -f api # one service's logs
8
+ # docker compose up -d # apply changes to this file or .env
9
+
10
+ name: hypha-deploy
11
+
12
+ services:
13
+ postgres:
14
+ image: postgres:18-alpine
15
+ restart: unless-stopped
16
+ # pg_stat_statements counts every query and its time: what to look at when
17
+ # something's slow (`SELECT … FROM pg_stat_statements` in psql).
18
+ command:
19
+ [
20
+ "postgres",
21
+ "-c",
22
+ "shared_preload_libraries=pg_stat_statements",
23
+ "-c",
24
+ "pg_stat_statements.track=all",
25
+ ]
26
+ environment:
27
+ POSTGRES_USER: hypha
28
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
29
+ POSTGRES_DB: hypha
30
+ volumes:
31
+ - postgres-data:/var/lib/postgresql
32
+ healthcheck:
33
+ test: ["CMD-SHELL", "pg_isready -U hypha -d hypha"]
34
+ interval: 2s
35
+ timeout: 3s
36
+ retries: 30
37
+ networks: [hypha]
38
+
39
+ # File storage over the S3 API: SeaweedFS, as in development. Browsers upload to it
40
+ # and read public files from it through Caddy at the media domain, so the API knows it
41
+ # by that address too (upload links are signed for the host they name).
42
+ s3:
43
+ image: chrislusf/seaweedfs:4.48
44
+ restart: unless-stopped
45
+ command: >-
46
+ server -dir=/data -ip=127.0.0.1 -ip.bind=0.0.0.0
47
+ -s3 -s3.port=8333 -s3.config=/config/s3.json
48
+ volumes:
49
+ - s3-data:/data
50
+ - ./seaweedfs/s3.json:/config/s3.json:ro
51
+ networks: [hypha]
52
+
53
+ api:
54
+ image: ${HYPHA_API_IMAGE:-hypha-api:current}
55
+ restart: unless-stopped
56
+ depends_on:
57
+ postgres:
58
+ condition: service_healthy
59
+ environment:
60
+ DATABASE_URL: postgres://hypha:${POSTGRES_PASSWORD}@postgres:5432/hypha
61
+ HYPHA_SECRET_KEY: ${HYPHA_SECRET_KEY:?}
62
+ HYPHA_OWNER_EMAIL: ${HYPHA_OWNER_EMAIL:-}
63
+ HYPHA_OWNER_PASSWORD: ${HYPHA_OWNER_PASSWORD:-}
64
+ HYPHA_STORE_NAME: ${HYPHA_STORE_NAME:-My store}
65
+ HYPHA_ADMIN_URL: ${ADMIN_URL:-}
66
+ # The API's public address: the OAuth issuer and the URLs apps are given.
67
+ HYPHA_PUBLIC_URL: ${API_URL:-}
68
+ # Caddy, the admin and the storefront reach the API from this network; what they
69
+ # put in X-Forwarded-For is believed from these addresses only.
70
+ HYPHA_TRUSTED_PROXIES: ${HYPHA_NETWORK:-172.30.250.0/24}
71
+ HYPHA_ALLOW_PRIVATE_CALLBACKS: ${HYPHA_ALLOW_PRIVATE_CALLBACKS:-false}
72
+ HYPHA_S3_ENDPOINT: ${MEDIA_URL:?}
73
+ HYPHA_S3_REGION: us-east-1
74
+ HYPHA_S3_BUCKET: hypha-media
75
+ HYPHA_S3_CREATE_BUCKET: "true"
76
+ HYPHA_S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY:?}
77
+ HYPHA_S3_SECRET_ACCESS_KEY: ${S3_SECRET_KEY:?}
78
+ HYPHA_MEDIA_URL: ${MEDIA_URL}/hypha-media
79
+ # The email provider's secret (hypha.config.toml's [email] names the sender).
80
+ HYPHA_RESEND_API_KEY: ${HYPHA_RESEND_API_KEY:-}
81
+ HYPHA_SMTP_PASSWORD: ${HYPHA_SMTP_PASSWORD:-}
82
+ RUST_LOG: ${RUST_LOG:-info}
83
+ volumes:
84
+ - ./hypha.config.toml:/etc/hypha/hypha.config.toml:ro
85
+ networks: [hypha]
86
+
87
+ admin:
88
+ image: ${HYPHA_ADMIN_IMAGE:-hypha-admin:current}
89
+ restart: unless-stopped
90
+ profiles: [admin]
91
+ depends_on: [api]
92
+ environment:
93
+ HYPHA_API_URL: http://api:3000
94
+ # Caddy appends the browser's address to X-Forwarded-For; the admin passes it on
95
+ # for the API's login limits.
96
+ ADMIN_TRUST_X_FORWARDED_FOR: "true"
97
+ networks: [hypha]
98
+
99
+ storefront:
100
+ image: ${HYPHA_STOREFRONT_IMAGE:-hypha-storefront:current}
101
+ restart: unless-stopped
102
+ profiles: [storefront]
103
+ depends_on: [api]
104
+ environment:
105
+ HYPHA_API_URL: http://api:3000
106
+ STOREFRONT_KEY: ${STOREFRONT_KEY:-}
107
+ HYPHA_WEBHOOK_SECRET: ${HYPHA_WEBHOOK_SECRET:-}
108
+ STOREFRONT_ROUTING: ${STOREFRONT_ROUTING:-folders}
109
+ STOREFRONT_URL: ${STOREFRONT_URL:-}
110
+ # As the admin's: the shopper's address from Caddy, for the API's per-address
111
+ # cart limit.
112
+ STOREFRONT_TRUST_X_FORWARDED_FOR: "true"
113
+ networks: [hypha]
114
+
115
+ caddy:
116
+ image: caddy:2.10-alpine
117
+ restart: unless-stopped
118
+ ports:
119
+ - "80:80"
120
+ - "443:443"
121
+ - "443:443/udp"
122
+ volumes:
123
+ - ./Caddyfile:/etc/caddy/Caddyfile:ro
124
+ - caddy-data:/data
125
+ - caddy-config:/config
126
+ networks:
127
+ hypha:
128
+ # The API reaches the file storage by its public address; inside this network
129
+ # that name leads straight to Caddy.
130
+ aliases:
131
+ - ${MEDIA_HOST:?}
132
+
133
+ networks:
134
+ hypha:
135
+ ipam:
136
+ config:
137
+ - subnet: ${HYPHA_NETWORK:-172.30.250.0/24}
138
+
139
+ volumes:
140
+ postgres-data:
141
+ s3-data:
142
+ caddy-data:
143
+ caddy-config: