aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-01-17 02:11:31 +0900
committernsfisis <nsfisis@gmail.com>2024-01-17 02:11:31 +0900
commitdeacd0dfc195bca41af631114804d29937337cd8 (patch)
treef1f83580e5bc892c0794ac41632bc0cce3498f65 /Makefile
parent38ddeb28ec846ee966d0fe6873585d697a9ef373 (diff)
downloadphperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.tar.gz
phperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.tar.zst
phperkaigi-2024-albatross-deacd0dfc195bca41af631114804d29937337cd8.zip
.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c5976e6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+DOCKER_COMPOSE := docker compose -f docker-compose.local.yml --env-file .env.local
+
+.PHONY: up
+up:
+ ${DOCKER_COMPOSE} up -d
+
+.PHONY: down
+down:
+ ${DOCKER_COMPOSE} down
+
+.PHONY: build
+build: build-assets
+ ${DOCKER_COMPOSE} build
+
+.PHONY: migrate
+migrate: down
+ ${DOCKER_COMPOSE} up -d albatross-db
+ ${DOCKER_COMPOSE} run --rm --entrypoint="php bin/albctl migrate" albatross-jobworker
+
+.PHONY: promote
+promote: up
+ ${DOCKER_COMPOSE} run --rm --entrypoint="php bin/albctl promote" albatross-jobworker
+
+.PHONY: deluser
+deluser: up
+ ${DOCKER_COMPOSE} run --rm --entrypoint="php bin/albctl deluser" albatross-jobworker
+
+.PHONY: sh
+sh:
+ ${DOCKER_COMPOSE} exec albatross-app sh
+
+.PHONY: psql
+psql:
+ ${DOCKER_COMPOSE} exec albatross-db psql -U postgres
+
+.PHONY: logs
+logs:
+ ${DOCKER_COMPOSE} logs
+
+.PHONY: build-assets
+build-assets: services/app/public/assets
+ docker build -t albatross-build-assets -f services/app/Dockerfile.frontend ./services/app
+ docker run --rm -v "$$(pwd)"/services/app/esbuild.mjs:/app/esbuild.mjs -v "$$(pwd)"/services/app/assets:/app/assets -v "$$(pwd)"/services/app/public/assets:/app/public/assets --env-file "$$(pwd)"/.env.local albatross-build-assets npm run build
+
+services/app/public/assets:
+ @mkdir -p services/app/public/assets