chore: change makefile targets

This commit is contained in:
Sonny
2023-10-31 20:15:49 +01:00
parent 3204e31759
commit a2a4d145df
3 changed files with 6 additions and 15 deletions

View File

@@ -1,18 +1,8 @@
CONTAINER_NAME = "docker-my-links-dev-db-1"
ROOT_PASSWORD = "root_passwd"
USER_NAME = "my-user"
db:
docker compose -f dev.docker-compose.yml up -d
start-dev:
@echo 'Starting DB container'
docker compose --env-file ../.env -f ./dev.docker-compose.yml up -d
@echo 'Waiting for a minute (need to set $(USER_NAME) privileges)'
@sleep 1m
@echo 'Grant privileges for $(USER_NAME)'
docker exec -it $(CONTAINER_NAME) mysql -u root -p$(ROOT_PASSWORD) -e "grant ALL PRIVILEGES ON *.* TO '$(USER_NAME)';flush privileges;"
@echo 'Dont forget to do migrations before run dev'
dev:
npm run dev
prod:
docker compose up -d --build

View File

@@ -2,6 +2,7 @@ version: "3.8"
services:
my-links-dev-db:
container_name: my-links-dev-db
image: mysql:latest
restart: always
env_file:

View File

@@ -1 +1 @@
CREATE DATABASE mylinks;
CREATE DATABASE IF NOT EXISTS mylinks;