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
|
||||
@-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)
|
||||
|
|
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