bluesky-pds-docker/Makefile

36 lines
No EOL
1.1 KiB
Makefile

TAG ?= latest
export DOCKER_BUILDKIT=1
export BUILDKIT_PROGRESS=plain
.PHONY: build-base
build-base:
docker build --tag pds-runtime ./base
.PHONY: build-tag
build-tag:
sudo rm -rf config
docker build --tag forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:$(TAG) .
.PHONY: generate-env
generate-env:
$(eval PDS_JWT_SECRET=$(shell openssl rand --hex 16))
$(eval PDS_ADMIN_PASSWORD=$(shell openssl rand --hex 16))
$(eval PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(shell openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32))
@echo "PDS_JWT_SECRET=$(PDS_JWT_SECRET)" > .env
@echo "PDS_ADMIN_PASSWORD=$(PDS_ADMIN_PASSWORD)" >> .env
@echo "PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=$(PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX)" >> .env
@echo "PDS_HOSTNAME=" >> .env
@echo "PUID=1000" >> .env
@echo "PGID=1000" >> .env
@echo "URL_NAME:" >> .env
@echo "URL_SUFFIX:" >> .env
.PHONY: run
run:
docker compose up
.PHONY: push
push:
docker push forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:latest