docs(core): clarify developing server docs (#9420)

This commit is contained in:
pengx17
2024-12-30 03:51:58 +00:00
parent b9f2650369
commit 87331b49b7
2 changed files with 17 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ services:
POSTGRES_USER: ${DB_USERNAME} POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_DB: ${DB_DATABASE_NAME}
volumes: volumes:
- ${DATABASE_LOCATION}:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
redis: redis:
image: redis:latest image: redis:latest
@@ -26,3 +26,6 @@ services:
networks: networks:
dev: dev:
volumes:
postgres_data:

View File

@@ -7,15 +7,25 @@ This document explains how to start server (@affine/server) locally with Docker
## Run required dev services in docker compose ## Run required dev services in docker compose
Running yarn's server package (@affine/server) requires some dev services to be running, i.e.:
- postgres
- redis
- mailhog
You can run these services in docker compose by running the following command:
```sh ```sh
cp ./.docker/dev/compose.yml.example ./.docker/dev/compose.yml cp ./.docker/dev/compose.yml.example ./.docker/dev/compose.yml
cp ./.docker/dev/.env.example ./.docker/dev/.env cp ./.docker/dev/.env.example ./.docker/dev/.env
docker compose -f ./.docker/dev/compose.yml up -d docker compose -f ./.docker/dev/compose.yml up
``` ```
## Build native packages (you need to setup rust toolchain first) ## Build native packages (you need to setup rust toolchain first)
Server also requires native packages to be built, you can build them by running the following command:
```sh ```sh
# build native # build native
yarn affine @affine/server-native build yarn affine @affine/server-native build
@@ -51,6 +61,8 @@ when server started, it will created a default user for testing:
yarn dev yarn dev
``` ```
You can login with the user (dev@affine.pro / dev) above to test the server.
## Done ## Done
Now you should be able to start developing affine with server enabled. Now you should be able to start developing affine with server enabled.