feat: provision dev deps using docker-compose

This commit is contained in:
Aravinth Manivannan 2024-05-18 20:41:52 +05:30
parent d5bcd3493b
commit 26ba1f4e1d
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 24 additions and 9 deletions

View file

@ -1,12 +1,8 @@
define deploy_dependencies ## deploy dependencies
@-docker create --name ${db} \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
postgres
docker start ${db}
@-docker-compose -f ./docker-compose-dev-deps.yml \
up -d
endef
define run_migrations ## run database migrations
cd utils/db-migrations/ && unset DATABASE_URL && cargo build
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
env.db: ## Deploy dependencies
env: ## Deploy dependencies
$(call deploy_dependencies)
sleep 5
$(call run_migrations)
env.db.recreate: ## Deploy dependencies from scratch
@-docker rm -f ${db}
env.recreate: ## Deploy dependencies from scratch
@-docker-compose -f ./docker-compose-dev-deps.yml \
down -v --remove-orphans
$(call deploy_dependencies)
sleep 5
$(call run_migrations)

View 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