Skip to content

Commit d7f01c0

Browse files
committed
add docker compose for jobs
1 parent 93df86b commit d7f01c0

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

docker-compose.jobs.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
services:
2+
# LaunchQL API server (GraphQL)
3+
launchql-server:
4+
container_name: launchql-server
5+
image: ghcr.io/constructive-io/launchql:b88e3d1
6+
# The image entrypoint already runs the LaunchQL CLI (`lql`).
7+
# We only need to provide the subcommand and flags here.
8+
entrypoint: ["lql", "server", "--port", "3000", "--origin", "*", "--strictAuth", "false"]
9+
depends_on:
10+
- postgres
11+
environment:
12+
NODE_ENV: development
13+
# Server
14+
PORT: "3000"
15+
SERVER_HOST: "0.0.0.0"
16+
SERVER_TRUST_PROXY: "true"
17+
SERVER_ORIGIN: "*" # allow all origins in dev
18+
SERVER_STRICT_AUTH: "false"
19+
# Postgres connection (matches postgres service)
20+
PGHOST: postgres
21+
PGPORT: "5432"
22+
PGUSER: postgres
23+
PGPASSWORD: password
24+
PGDATABASE: launchql # ensure this DB exists and has migrations applied
25+
# API meta configuration (static mode for dev)
26+
API_ENABLE_META: "true"
27+
API_EXPOSED_SCHEMAS: "collections_public,meta_public"
28+
API_ANON_ROLE: "administrator"
29+
API_ROLE_NAME: "administrator"
30+
API_DEFAULT_DATABASE_ID: "dbe"
31+
ports:
32+
- "3000:3000"
33+
networks:
34+
- constructive-net
35+
36+
# Simple email function (Knative-style HTTP function)
37+
simple-email:
38+
container_name: simple-email
39+
image: ghcr.io/constructive-io/launchql:b88e3d1
40+
# Override the image entrypoint (LaunchQL CLI) and run the Node function directly.
41+
entrypoint: ["node", "functions/simple-email/dist/index.js"]
42+
environment:
43+
NODE_ENV: development
44+
LOG_LEVEL: info
45+
# Mailgun / email provider configuration for @launchql/postmaster
46+
# Replace with real credentials for local testing.
47+
MAILGUN_API_KEY: "change-me-mailgun-api-key"
48+
MAILGUN_DOMAIN: "mg.constructive.io"
49+
MAILGUN_FROM: "[email protected]"
50+
ports:
51+
# Expose function locally (optional)
52+
- "8081:8080"
53+
networks:
54+
- constructive-net
55+
56+
# Jobs runtime: callback server + worker + scheduler
57+
knative-job-service:
58+
container_name: knative-job-service
59+
image: ghcr.io/constructive-io/launchql:b88e3d1
60+
# Override the image entrypoint and run the jobs runtime directly.
61+
entrypoint: ["node", "jobs/knative-job-service/dist/run.js"]
62+
depends_on:
63+
- simple-email
64+
environment:
65+
NODE_ENV: development
66+
67+
# Postgres (jobs extension lives in this DB)
68+
PGUSER: postgres
69+
PGHOST: postgres
70+
PGPASSWORD: password
71+
PGPORT: "5432"
72+
PGDATABASE: jobs # ensure this DB exists and has launchql-ext-jobs installed
73+
JOBS_SCHEMA: app_jobs
74+
75+
# Worker configuration
76+
JOBS_SUPPORT_ANY: "false"
77+
JOBS_SUPPORTED: "simple-email"
78+
HOSTNAME: "knative-job-service-1"
79+
80+
# Callback HTTP server (job completion callbacks)
81+
INTERNAL_JOBS_CALLBACK_PORT: "8080"
82+
INTERNAL_JOBS_CALLBACK_URL: "http://knative-job-service:8080"
83+
84+
# Function gateway base URL (used by worker when no dev map is present)
85+
# Not used in dev when INTERNAL_GATEWAY_DEVELOPMENT_MAP is set, but required for validation.
86+
KNATIVE_SERVICE_URL: "dev.internal"
87+
INTERNAL_GATEWAY_URL: "http://simple-email:8080"
88+
89+
# Development-only map from task identifier -> function URL
90+
# Used by @launchql/knative-job-worker when NODE_ENV !== 'production'.
91+
# This lets the worker call the simple-email container directly in docker-compose.
92+
INTERNAL_GATEWAY_DEVELOPMENT_MAP: '{"simple-email":"http://simple-email:8080"}'
93+
94+
ports:
95+
- "8080:8080"
96+
networks:
97+
- constructive-net
98+
99+
networks:
100+
constructive-net:
101+
external: true
102+
name: constructive-net

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
- ./bin:/sql-bin
1414
- ./packages:/sql-packages
1515
- ./extensions:/sql-extensions
16+
networks:
17+
- constructive-net
1618

1719
minio:
1820
container_name: minio
@@ -25,3 +27,9 @@ services:
2527
expose:
2628
- "9000"
2729
command: server /data
30+
networks:
31+
- constructive-net
32+
33+
networks:
34+
constructive-net:
35+
name: constructive-net

0 commit comments

Comments
 (0)