feat: provision dev deps using docker-compose
This commit is contained in:
parent
d5bcd3493b
commit
26ba1f4e1d
2 changed files with 24 additions and 9 deletions
15
Makefile
15
Makefile
|
@ -1,12 +1,8 @@
|
||||||
define deploy_dependencies ## deploy dependencies
|
define deploy_dependencies ## deploy dependencies
|
||||||
@-docker create --name ${db} \
|
@-docker-compose -f ./docker-compose-dev-deps.yml \
|
||||||
-e POSTGRES_PASSWORD=password \
|
up -d
|
||||||
-p 5432:5432 \
|
|
||||||
postgres
|
|
||||||
docker start ${db}
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
define run_migrations ## run database migrations
|
define run_migrations ## run database migrations
|
||||||
cd utils/db-migrations/ && unset DATABASE_URL && cargo build
|
cd utils/db-migrations/ && unset DATABASE_URL && cargo build
|
||||||
cd utils/db-migrations/ && cargo run
|
cd utils/db-migrations/ && cargo run
|
||||||
|
@ -58,13 +54,14 @@ docker.publish: docker.build ## Build and publish docker images
|
||||||
docker push libresolutions/vanikam:0.1.0
|
docker push libresolutions/vanikam:0.1.0
|
||||||
|
|
||||||
|
|
||||||
env.db: ## Deploy dependencies
|
env: ## Deploy dependencies
|
||||||
$(call deploy_dependencies)
|
$(call deploy_dependencies)
|
||||||
sleep 5
|
sleep 5
|
||||||
$(call run_migrations)
|
$(call run_migrations)
|
||||||
|
|
||||||
env.db.recreate: ## Deploy dependencies from scratch
|
env.recreate: ## Deploy dependencies from scratch
|
||||||
@-docker rm -f ${db}
|
@-docker-compose -f ./docker-compose-dev-deps.yml \
|
||||||
|
down -v --remove-orphans
|
||||||
$(call deploy_dependencies)
|
$(call deploy_dependencies)
|
||||||
sleep 5
|
sleep 5
|
||||||
$(call run_migrations)
|
$(call run_migrations)
|
||||||
|
|
18
docker-compose-dev-deps.yml
Normal file
18
docker-compose-dev-deps.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
email:
|
||||||
|
image: maildev/maildev:latest
|
||||||
|
restart: always
|
||||||
|
container_name: vanigam-dash-maildev
|
||||||
|
network_mode: host
|
||||||
|
environment:
|
||||||
|
- MAILDEV_SMTP_PORT=10025
|
||||||
|
- MAILDEV_INCOMING_USER=admin
|
||||||
|
- MAILDEV_INCOMING_PASS=password
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:13.2
|
||||||
|
network_mode: host
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: password
|
Loading…
Reference in a new issue