Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions scripts/dev/coder/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Replace the image defaults below with your internal registry references.
# Images must provide the same executables as the upstream counterparts.
# Start through ./scripts/dev/coder/dev.sh so databases, bucket and Temporal
# search attributes are initialized by the normal development launcher.
name: ${COMPOSE_PROJECT_NAME:-lightspeed-dev}

services:
postgres:
extends:
file: ../docker-compose.yaml
service: postgres
image: ${POSTGRES_IMAGE:-postgres:17}

pgadmin:
extends:
file: ../docker-compose.yaml
service: pgadmin
image: ${PGADMIN_IMAGE:-dpage/pgadmin4:8}

minio:
extends:
file: ../docker-compose.yaml
service: minio
image: ${MINIO_IMAGE:-chainguard/minio:latest}
# Override MINIO_USER if the internal image requires a non-root identity.
# That identity must have write access to the minio-data volume.
user: ${MINIO_USER:-0:0}

mc:
extends:
file: ../docker-compose.yaml
service: mc
image: ${MINIO_MC_IMAGE:-chainguard/minio-client:latest}
entrypoint: ["mc"]

temporal:
extends:
file: ../docker-compose.yaml
service: temporal
image: ${TEMPORAL_IMAGE:-temporalio/admin-tools:latest}
# Use an image containing the Temporal CLI, not just temporal-server.
# Explicitly replace any image entrypoint; the launcher also invokes
# `temporal operator ...` via docker compose exec during initialization.
entrypoint: ["temporal"]
command:
- server
- start-dev
- --ip
- 0.0.0.0
- --ui-ip
- 0.0.0.0
- --db-filename
- /home/temporal/temporal.db
# Adjust the database path and inherited volume mount together if your
# internal image uses another writable home. This is a development server.

volumes:
postgres-data:
pgadmin-data:
minio-data:
temporal-data:
9 changes: 9 additions & 0 deletions scripts/dev/coder/dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -Eeuo pipefail

CODER_DEV_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export LIGHTSPEED_DEV_COMPOSE_FILE="${CODER_DEV_DIR}/compose.yaml"

# All normal launcher commands are supported, including status, stop and down.
# Registry authentication uses your existing Docker configuration.
exec bash "${CODER_DEV_DIR}/../../../dev.sh" "$@"
24 changes: 24 additions & 0 deletions scripts/dev/compose.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import test from "node:test";

const root = fileURLToPath(new URL("../../", import.meta.url));

for (const override of ["", "/tmp/internal images/compose.yaml"]) {
test(`infrastructure commands use ${override ? "the selected" : "the default"} Compose file`, () => {
const result = spawnSync("bash", ["-c", `
source scripts/dev/lib/common.sh
docker() { printf '%s\\n' "$@"; }
compose ps
`], {
cwd: root,
encoding: "utf8",
env: { ...process.env, LIGHTSPEED_DEV_COMPOSE_FILE: override },
});
assert.equal(result.status, 0, result.stderr);
assert.deepEqual(result.stdout.trim().split("\n"), [
"compose", "-f", override || `${root}scripts/dev/docker-compose.yaml`, "ps",
]);
});
}
2 changes: 1 addition & 1 deletion scripts/dev/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
LIGHTSPEED_DEV_COMMON_DIR="$(cd "$(dirname "${LIGHTSPEED_DEV_COMMON_PATH}")" && pwd)"
DEV_DIR="$(cd "${LIGHTSPEED_DEV_COMMON_DIR}/.." && pwd)"
REPO_ROOT="$(cd "${DEV_DIR}/../.." && pwd)"
COMPOSE_FILE="${DEV_DIR}/docker-compose.yaml"
COMPOSE_FILE="${LIGHTSPEED_DEV_COMPOSE_FILE:-${DEV_DIR}/docker-compose.yaml}"

COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-lightspeed-dev}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/stack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ async function runDevelopmentAction(options, env) {
"--project-name",
env.COMPOSE_PROJECT_NAME ?? "lightspeed-dev",
"-f",
path.join(devDir, "docker-compose.yaml"),
env.LIGHTSPEED_DEV_COMPOSE_FILE ?? path.join(devDir, "docker-compose.yaml"),
"ps",
],
env,
Expand Down