Merge pull request #14 from ahashim/dockerizing-db-and-cache

Dockerizing db and cache
This commit is contained in:
Mike Stefanello 2022-10-10 19:53:55 -04:00 committed by GitHub
commit 434d7b44b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View File

@ -1,22 +1,22 @@
# Connect to the primary database
.PHONY: db
db:
psql postgresql://admin:admin@localhost:5432/app
docker compose exec -it db psql postgresql://admin:admin@localhost:5432/app
# Connect to the test database
.PHONY: db-test
db-test:
psql postgresql://admin:admin@localhost:5432/app_test
docker compose exec -it db psql postgresql://admin:admin@localhost:5432/app_test
# Connect to the primary cache
.PHONY: cache
cache:
redis-cli
docker compose exec -it cache redis-cli
# Connect to the test cache
.PHONY: cache-test
cache-test:
redis-cli -n 1
docker compose exec -it cache redis-cli -n 1
# Install Ent code-generation module
.PHONY: ent-install
@ -36,13 +36,13 @@ ent-new:
# Start the Docker containers
.PHONY: up
up:
docker-compose up -d
docker compose up -d
sleep 3
# Rebuild Docker containers to wipe all data
.PHONY: reset
reset:
docker-compose down
docker compose down
make up
# Run the application

View File

@ -151,8 +151,6 @@ Ensure the following are installed on your system:
- [Go](https://go.dev/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [psql](https://www.postgresql.org/docs/13/app-psql.html) _(optional)_
- [redis-cli](https://redis.io/topics/rediscli) _(optional)_
### Start the application