summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-09-10 17:42:13 -0600
committermo khan <mo@mokhan.ca>2025-09-10 17:42:13 -0600
commitbbda943304fda76ab211be60f62163608bf6f261 (patch)
tree672a40e732bf263132e274d2478b45bf1c2cde36
parent9081607de417823e17ad966bf1ce73d298bb70f4 (diff)
chore: split the Procfile for each environment
-rw-r--r--.gitignore5
-rw-r--r--Dockerfile2
-rw-r--r--Makefile18
-rw-r--r--Procfile.development (renamed from Procfile.template)2
-rw-r--r--Procfile.production4
-rw-r--r--Procfile.test4
-rw-r--r--test/integration/container.go1
7 files changed, 17 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 65ba73b..b6cfd39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,3 @@
.env.*
/tmp
/log
-.claude/
-
-# Generated Procfiles (use Procfile.template as source)
-Procfile
-Procfile.dev
diff --git a/Dockerfile b/Dockerfile
index cb053a0..cd22c48 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -29,7 +29,7 @@ USER nonroot
COPY --from=dumb-init-builder /usr/bin/dumb-init /bin/dumb-init
COPY --from=envoy-binary /usr/local/bin/envoy /bin/envoy
COPY --from=spicedb-binary /usr/local/bin/spicedb /bin/spicedb
-COPY --from=build /app/Procfile /Procfile
+COPY --from=build /app/Procfile.production /Procfile
COPY --from=build /app/bin/envoy-shim /bin/envoy-shim
COPY --from=build /app/etc/envoy /etc/envoy
COPY --from=build /app/etc/authzd /etc/authzd
diff --git a/Makefile b/Makefile
index 467479a..a25c683 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ SPICEDB := bin/spicedb
TOOL := bin/tool
ZED := bin/zed
-.PHONY: clean setup build test run db-setup db-create db-stop db-reset
+.PHONY: db-clean clean setup build test-schema test-unit test-race test-integration test build-image run run-image lint tidy db-schema-load db-seed db-stop db-reset db-init db-create db-migrate db-console db-setup
$(AUTHZD_BIN): $(shell find . -name "*.go" 2>/dev/null) go.sum
@$(GO) build -mod=vendor -o $(AUTHZD_BIN) ./cmd/authzd/main.go
@@ -22,7 +22,7 @@ db-clean:
@rm -rf tmp/postgres tmp/postgres.log
clean: db-clean
- @rm -f $(AUTHZD_BIN) $(SPARKLED_BIN) Procfile Procfile.dev
+ @rm -f $(AUTHZD_BIN) $(SPARKLED_BIN)
@$(GO) clean -testcache
setup:
@@ -32,12 +32,6 @@ setup:
fi
@$(MISE) exec python -- pip install dumb-init
-Procfile: Procfile.template
- @grep -v "# DEV_ONLY:" Procfile.template > Procfile
-
-Procfile.dev: Procfile.template
- @sed 's/# DEV_ONLY: //' Procfile.template > Procfile.dev
-
build: $(AUTHZD_BIN) $(SPARKLED_BIN)
test-schema:
@@ -54,14 +48,14 @@ test-integration: build-image
test: clean test-unit test-race test-integration test-schema
-build-image: Procfile
+build-image:
@$(DOCKER) build --network=host --tag $(IMAGE_TAG) .
-run: clean build Procfile.dev db-init
- @$(TOOL) godotenv -f .env.local,.env $(TOOL) minit -f Procfile.dev
+run: clean build db-init
+ @$(TOOL) godotenv -f .env.local,.env $(TOOL) minit -f Procfile.development
run-image: clean build-image
- @$(DOCKER) run --rm --network host --env-file .env.local -p 10000:10000 -it $(IMAGE_TAG)
+ @$(DOCKER) run --rm --network host --env-file .env.local -v $(PWD)/Procfile.development:/Procfile -p 10000:10000 -it $(IMAGE_TAG)
lint:
@$(TOOL) yamlfmt -lint -exclude vendor .
diff --git a/Procfile.template b/Procfile.development
index 60d609e..9481a58 100644
--- a/Procfile.template
+++ b/Procfile.development
@@ -1,4 +1,4 @@
-# DEV_ONLY: postgres: ./bin/postgres -D tmp/postgres -c config_file=etc/postgres/postgresql.conf
+postgres: ./bin/postgres -D tmp/postgres -c config_file=etc/postgres/postgresql.conf
spicedb: ./bin/spicedb serve --grpc-preshared-key $ZED_TOKEN --http-addr :8081 --grpc-addr :50051 --datastore-engine postgres --datastore-conn-uri $DATABASE_URL --log-level $LOG_LEVEL --log-format json --telemetry-endpoint "" --skip-release-check
authzd: ./bin/authzd
envoy: ./bin/envoy-shim
diff --git a/Procfile.production b/Procfile.production
new file mode 100644
index 0000000..41fc5e1
--- /dev/null
+++ b/Procfile.production
@@ -0,0 +1,4 @@
+spicedb: ./bin/spicedb serve --grpc-preshared-key $ZED_TOKEN --http-addr :8081 --grpc-addr :50051 --datastore-engine memory --log-level $LOG_LEVEL --log-format json --telemetry-endpoint "" --skip-release-check
+authzd: ./bin/authzd
+envoy: ./bin/envoy-shim
+sparkled: ./bin/sparkled
diff --git a/Procfile.test b/Procfile.test
new file mode 100644
index 0000000..b4d272e
--- /dev/null
+++ b/Procfile.test
@@ -0,0 +1,4 @@
+spicedb: ./bin/spicedb serve --grpc-preshared-key $ZED_TOKEN --http-addr :8081 --grpc-addr :50051 --datastore-engine postgres --datastore-conn-uri $DATABASE_URL --log-level $LOG_LEVEL --log-format json --telemetry-endpoint "" --skip-release-check
+authzd: ./bin/authzd
+envoy: ./bin/envoy-shim
+sparkled: ./bin/sparkled
diff --git a/test/integration/container.go b/test/integration/container.go
index c95bdfd..b385e18 100644
--- a/test/integration/container.go
+++ b/test/integration/container.go
@@ -23,6 +23,7 @@ func NewContainer(t *testing.T, ctx context.Context, envVars map[string]string)
testcontainers.WithEnv(envVars),
testcontainers.WithLogConsumers(&Logger{TB: t}),
testcontainers.WithLogger(log.TestLogger(t)),
+ testcontainers.WithMounts(testcontainers.BindMount("Procfile.test", "/Procfile")),
testcontainers.WithWaitStrategy(
wait.ForHTTP("/").WithPort("10000"),
),