-
Notifications
You must be signed in to change notification settings - Fork 56
Running on your machine
Minjun Kim edited this page Mar 2, 2020
·
1 revision
This document will guide you through how to run velog server on your own machine for development or testing purposes.
Following tools should be installed before running velog server
- Node.js LTS (v12)
- Yarn Classic v1
- Docker
- Docker-compose
git clone https://github.com/velopert/velog-server.gitcd ./velog-server/docker/postgresql
docker-compose up -d
# To close database server enter following command:
# docker-compose downIf you run your PostgreSQL server, the database will be initialized with following configuration:
| Name | Value |
|---|---|
| Host | localhost |
| Port | 5432 |
| Database | velog |
| User | velog |
| Password | velogpw |
Information above is already set in .env.development so there is no need to edit your .env.development file
Redis server is only required for cache system of server side rendering. It is not mandatory to run the server, however, you will see error messages repeatedly on server console when redis is not running.
cd ./velog-server/docker/redis
docker-compose up -d
# To close database server enter following command:
# docker-compose downElasticSearch is used as search engine of velog.
cd ./velog-server/docker/search
docker-compose up -dAfter running ElasticSearch server, make following request via any HTTP client (e.g. Postman)
PUT http://localhost:9200/posts
{
"settings": {
"analysis": {
"tokenizer": {
"korean_nori_tokenizer": {
"type": "nori_tokenizer",
"decompound_mode": "mixed"
}
},
"analyzer": {
"nori_analyzer": {
"type": "custom",
"tokenizer": "korean_nori_tokenizer",
"filter": [
"nori_posfilter"
]
}
},
"filter": {
"nori_posfilter": {
"type": "nori_part_of_speech",
"stoptags": [
"E",
"IC",
"J",
"MAG",
"MM",
"NA",
"NR",
"SC",
"SE",
"SF",
"SH",
"SL",
"SN",
"SP",
"SSC",
"SSO",
"SY",
"UNA",
"UNKNOWN",
"VA",
"VCN",
"VCP",
"VSV",
"VV",
"VX",
"XPN",
"XR",
"XSA",
"XSN",
"XSV"
]
}
}
}
},
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "nori_analyzer",
"fields": {
"raw": {
"type": "text"
}
}
},
"body": {
"type": "text",
"analyzer": "nori_analyzer",
"fields": {
"raw": {
"type": "text"
}
}
}
}
}
}
cd ./velog-server/
yarn install
yarn dev