Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
45 lines (44 loc) · 1.63 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
45 lines (44 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# The write API, standalone. Assumes a hosted PowerSync instance and a database you already run —
# this project owns neither. Set DATABASE_TYPE / DATABASE_URI in .env and export the instance's
# auth config as described in docs/auth/setup.md.
services:
backend:
build:
context: ./backend
dockerfile: standalone/Dockerfile
# Bounded on purpose. A configuration error exits 1, and `unless-stopped` would respawn it
# forever, scrolling the message past. Three attempts still covers a transient crash.
restart: on-failure:3
# Configuration comes from .env then .env.local (later wins); see the README. Everything in
# them reaches the container, including AUTH_*.
# Do not list a variable under `environment:` below: it would override both files.
env_file:
- path: .env
required: false
- path: .env.local
required: false
environment:
PORT: "6060"
POWERSYNC_CONFIG_PATH: /app/standalone/config/powersync-config.json
volumes:
# The directory, not the file, so a missing export is the backend's error to report and
# AUTH_MODE=env can start without one.
- type: bind
source: ${POWERSYNC_CONFIG_DIR:-./backend/standalone/config}
target: /app/standalone/config
read_only: true
bind:
create_host_path: false
ports:
- "6060:6060"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:6060/').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
]
interval: 5s
timeout: 2s
retries: 15