From b59b948ed98f5cb1b6e6e2e6f67a9894e367df95 Mon Sep 17 00:00:00 2001 From: Sonny Date: Wed, 10 Apr 2024 19:31:15 +0200 Subject: [PATCH] fix: dev environment variables --- Makefile | 2 +- docker-compose.yml | 2 -- docker-config/mysql-dev-init.sql | 3 --- example.env | 7 ++----- 4 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 docker-config/mysql-dev-init.sql diff --git a/Makefile b/Makefile index 85f4f9e..e4ed8cf 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ db: docker compose -f dev.docker-compose.yml up -d --wait dev: db - npx prisma migrate deploy + npx prisma db push npx prisma generate npm run dev diff --git a/docker-compose.yml b/docker-compose.yml index 491143f..7bffded 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,8 +30,6 @@ services: container_name: MyLinksDB image: mysql:latest restart: always - volumes: - - ./docker-config/mysql-dev-init.sql:/docker-entrypoint-initdb.d/init.sql env_file: - .env healthcheck: diff --git a/docker-config/mysql-dev-init.sql b/docker-config/mysql-dev-init.sql deleted file mode 100644 index 902751b..0000000 --- a/docker-config/mysql-dev-init.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE DATABASE IF NOT EXISTS mylinks; - -GRANT ALL PRIVILEGES ON DATABASE * TO mluser; \ No newline at end of file diff --git a/example.env b/example.env index f13115c..e46d3f3 100644 --- a/example.env +++ b/example.env @@ -1,12 +1,9 @@ -MYSQL_USER="root" +MYSQL_USER="mluser" MYSQL_PASSWORD="root" MYSQL_ROOT_PASSWORD="root" MYSQL_DATABASE="mylinks" -# Or if you need external Database -# DATABASE_IP="localhost" -# DATABASE_PORT="3306" -# DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${DATABASE_IP}:${DATABASE_PORT}/${MYSQL_DATABASE}" +DATABASE_URL="mysql://root:${MYSQL_ROOT_PASSWORD}@localhost:3306/${MYSQL_DATABASE}" NEXTAUTH_URL="http://localhost:3000" NEXT_PUBLIC_SITE_URL="http://localhost:3000"