Merge pull request #14 from ahashim/dockerizing-db-and-cache
Dockerizing db and cache
This commit is contained in:
commit
99a7ec8a9e
2 changed files with 12 additions and 14 deletions
12
Makefile
12
Makefile
|
|
@ -1,22 +1,22 @@
|
||||||
# Connect to the primary database
|
# Connect to the primary database
|
||||||
.PHONY: db
|
.PHONY: db
|
||||||
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
|
# Connect to the test database
|
||||||
.PHONY: db-test
|
.PHONY: db-test
|
||||||
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
|
# Connect to the primary cache
|
||||||
.PHONY: cache
|
.PHONY: cache
|
||||||
cache:
|
cache:
|
||||||
redis-cli
|
docker compose exec -it cache redis-cli
|
||||||
|
|
||||||
# Connect to the test cache
|
# Connect to the test cache
|
||||||
.PHONY: cache-test
|
.PHONY: cache-test
|
||||||
cache-test:
|
cache-test:
|
||||||
redis-cli -n 1
|
docker compose exec -it cache redis-cli -n 1
|
||||||
|
|
||||||
# Install Ent code-generation module
|
# Install Ent code-generation module
|
||||||
.PHONY: ent-install
|
.PHONY: ent-install
|
||||||
|
|
@ -36,13 +36,13 @@ ent-new:
|
||||||
# Start the Docker containers
|
# Start the Docker containers
|
||||||
.PHONY: up
|
.PHONY: up
|
||||||
up:
|
up:
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# Rebuild Docker containers to wipe all data
|
# Rebuild Docker containers to wipe all data
|
||||||
.PHONY: reset
|
.PHONY: reset
|
||||||
reset:
|
reset:
|
||||||
docker-compose down
|
docker compose down
|
||||||
make up
|
make up
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,6 @@ Ensure the following are installed on your system:
|
||||||
- [Go](https://go.dev/)
|
- [Go](https://go.dev/)
|
||||||
- [Docker](https://www.docker.com/)
|
- [Docker](https://www.docker.com/)
|
||||||
- [Docker Compose](https://docs.docker.com/compose/install/)
|
- [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
|
### Start the application
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue