From 57dc43b6541b4a7f1ea3c395f4b417f0eb0c93de Mon Sep 17 00:00:00 2001 From: hildxd Date: Thu, 25 Jan 2024 10:58:17 +0800 Subject: [PATCH] chore: readme --- .env.example | 2 ++ README.md | 31 +++++++++++++++++++++++++++++++ docker-compose.yml | 21 +++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .env.example create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..114b94992 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +DATABASE_URL="mysql://root:password@127.0.0.1:3306/earthworm_nest" +SECRET="sjldk92#sd903mnc./xklsjdf9sdfj" \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 000000000..394231f66 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Earthworm + +## How to run + +### in mac + +1. Install dependencies +```bash +brew install docker orbstack +``` +2. open orbstack + +3. run commands +```bash +## In this project directory +## Run sql and redis services +docker compose up -d +## Configure environment variables +cp .env.example .env +pnpm install +pnpm db:init +pnpm data:init +``` +4. run serve +```bash +pnpm serve:dev +``` +5. run client +```run +pnpm client:dev +``` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..1efd67e13 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.8' + +services: + mysql: + image: mysql:latest + environment: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: earthworm_nest + command: --default-authentication-plugin=mysql_native_password + ports: + - "3306:3306" + redis: + image: redis:5-alpine + restart: always + volumes: + - redis_data:/var/lib/redis + ports: + - 6379:6379 +volumes: + redis_data: + driver: local