aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile.prod
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-30 00:27:46 +0900
committernsfisis <nsfisis@gmail.com>2024-07-30 00:27:46 +0900
commit432593ddc20e4248c6fe134d13f9c25bad7e39f7 (patch)
treeb60ac9ce2102367f345110d451abe19e1b6219bf /Makefile.prod
parent7e2704c90ffba3612bd87ed342d4f310b0de78c0 (diff)
parent0908e5d2041ded22969da7d66ead59d5037d40dd (diff)
downloadphperkaigi-2025-albatross-432593ddc20e4248c6fe134d13f9c25bad7e39f7.tar.gz
phperkaigi-2025-albatross-432593ddc20e4248c6fe134d13f9c25bad7e39f7.tar.zst
phperkaigi-2025-albatross-432593ddc20e4248c6fe134d13f9c25bad7e39f7.zip
Merge branch 'feat/local-dev'
Diffstat (limited to 'Makefile.prod')
-rw-r--r--Makefile.prod39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile.prod b/Makefile.prod
new file mode 100644
index 0000000..05901f0
--- /dev/null
+++ b/Makefile.prod
@@ -0,0 +1,39 @@
+DOCKER_COMPOSE := docker compose -f compose.prod.yaml
+
+.PHONY: build
+build:
+ ${DOCKER_COMPOSE} build
+
+.PHONY: up
+up:
+ ${DOCKER_COMPOSE} up -d
+
+.PHONY: down
+down:
+ ${DOCKER_COMPOSE} down
+
+.PHONY: logs
+logs:
+ ${DOCKER_COMPOSE} logs
+
+.PHONY: psql
+psql:
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} exec db psql --user=postgres albatross
+
+.PHONY: psql-query
+psql-query:
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} exec --no-TTY db psql --user=postgres albatross
+
+.PHONY: sqldef-dryrun
+sqldef-dryrun: down
+ ${DOCKER_COMPOSE} build db
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} run --no-TTY tools psqldef --dry-run < ./backend/schema.sql
+
+.PHONY: sqldef
+sqldef: down
+ ${DOCKER_COMPOSE} build db
+ ${DOCKER_COMPOSE} up --wait db
+ ${DOCKER_COMPOSE} run --no-TTY tools psqldef < ./backend/schema.sql