mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
doc: update Windows setup guide
This commit is contained in:
1 parent
ba251fb933
commit
860b257ea7
3 files changed
+85
-85
No files matched your search
+80
-83
@@ -1,69 +1,40 @@
|
||||
# Windows Environment Setup
|
||||
|
||||
## Prerequisites
|
||||
## Install WSL and Ubuntu
|
||||
|
||||
1. Have a computer with Windows 10 or later.
|
||||
1. Install WSL and Ubuntu on Windows.
|
||||
1. Enter Ubuntu terminal.
|
||||
Please refer to the Official [Setup WSL](https://learn.microsoft.com/en-us/windows/wsl/setup/environment) on Microsoft's website.
|
||||
|
||||
Run the following command in PowerShell as Administrator:
|
||||
|
||||
wsl --install
|
||||
|
||||
Then restart the computer. After restarting, you can open Ubuntu terminal by searching "Ubuntu" in Start menu. You will be prompted to create a new user account. Once you have done that, you can continue with the following steps.
|
||||
|
||||
## Setup Environment (In Ubuntu terminal)
|
||||
|
||||
1. Update and upgrade
|
||||
|
||||
```
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get upgrade
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
```
|
||||
|
||||
1. Install Git
|
||||
|
||||
```
|
||||
$ sudo apt-get install git
|
||||
sudo apt-get install git
|
||||
```
|
||||
|
||||
1. Install Node.js (Version 20.x)
|
||||
|
||||
```
|
||||
$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
$ sudo apt-get install nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
sudo apt-get install nodejs
|
||||
sudo apt install build-essential
|
||||
sudo npm install -g yarn
|
||||
```
|
||||
|
||||
1. [Install Docker](#install-docker)
|
||||
1. [Install Python 2.7](#install-python-27)
|
||||
|
||||
## Run the Project (In Ubuntu terminal)
|
||||
|
||||
1. Installation
|
||||
|
||||
```
|
||||
$ git clone https://github.com/lancatlin/linux-odyssey.git
|
||||
$ cd linux-odyssey
|
||||
$ yarn install
|
||||
```
|
||||
|
||||
1. Docker setup
|
||||
|
||||
```
|
||||
$ docker compose pull
|
||||
$ docker compose build
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
<!-- Check folder ./config exist and is empty -->
|
||||
<!-- Check .env file exist -->
|
||||
|
||||
1. Run the project
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
$ yarn dev
|
||||
```
|
||||
|
||||
<!-- Check ./config/ssh_key.pub is a file not a folder -->
|
||||
|
||||
## References
|
||||
|
||||
### Install Docker
|
||||
## Install Docker
|
||||
|
||||
(Refer to [get.docker.com](https://get.docker.com/))
|
||||
|
||||
@@ -73,72 +44,98 @@ dependencies:
|
||||
1. Download the script
|
||||
|
||||
```
|
||||
$ curl -fsSL https://get.docker.com -o install-docker.sh
|
||||
curl -fsSL https://get.docker.com -o install-docker.sh
|
||||
```
|
||||
|
||||
1. verify the script's content
|
||||
|
||||
```
|
||||
$ cat install-docker.sh
|
||||
cat install-docker.sh
|
||||
```
|
||||
|
||||
1. run the script with --dry-run to verify the steps it executes
|
||||
|
||||
```
|
||||
$ sh install-docker.sh --dry-run
|
||||
sh install-docker.sh --dry-run
|
||||
```
|
||||
|
||||
**NOTE: the script will recommend you to use Docker Desktop instead, but we need to use Docker inside WSL for the backend to work.** Just ignore it and wait for the installation to finish.
|
||||
|
||||
1. run the script either as root, or using sudo to perform the installation.
|
||||
|
||||
```
|
||||
$ sudo sh install-docker.sh
|
||||
sudo sh install-docker.sh
|
||||
```
|
||||
|
||||
1. Verify the installation
|
||||
|
||||
```
|
||||
$ docker --version
|
||||
docker --version
|
||||
```
|
||||
|
||||
### Install Python 2.7
|
||||
|
||||
1. Install required packages
|
||||
1. Add your user to the docker group
|
||||
|
||||
```
|
||||
$ sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
1. Install pyenv
|
||||
|
||||
```
|
||||
$ curl https://pyenv.run | bash
|
||||
```
|
||||
|
||||
1. Add following lines to bash configuration file (e.g. `~/.bashrc`, `~/.bash_profile`, `~/.zshrc`)
|
||||
|
||||
```
|
||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
```
|
||||
|
||||
1. Restart the shell
|
||||
|
||||
1. Install Python 2.7.18 using pyenv
|
||||
|
||||
```
|
||||
$ pyenv install 2.7.18
|
||||
```
|
||||
|
||||
1. Set Python 2.7.18 as the global version
|
||||
|
||||
```
|
||||
$ pyenv global 2.7.18
|
||||
```
|
||||
**NOTE: You need to create a new WSL terminal to apply the changes.**
|
||||
|
||||
1. Verify the installation
|
||||
|
||||
```
|
||||
$ python --version
|
||||
docker ps
|
||||
```
|
||||
This should return something like:
|
||||
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
|
||||
## Run the Project (In Ubuntu terminal)
|
||||
|
||||
1. Clone the repository
|
||||
|
||||
```
|
||||
git clone https://github.com/lancatlin/linux-odyssey.git
|
||||
cd linux-odyssey
|
||||
```
|
||||
|
||||
Optional: To open the project in VSCode, run the following command inside the project folder:
|
||||
|
||||
```
|
||||
code .
|
||||
```
|
||||
|
||||
1. Install dependencies
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
It is ok if there are some warnings and `gyp: ERR` errors, just verify there is `done` at the end.
|
||||
|
||||
1. Copy the environment variables
|
||||
|
||||
```
|
||||
cp .env.sample .env
|
||||
```
|
||||
|
||||
1. Docker setup
|
||||
|
||||
```
|
||||
docker compose pull
|
||||
docker compose build
|
||||
docker compose up -d db
|
||||
```
|
||||
|
||||
<!-- Check folder ./config exist and is empty -->
|
||||
<!-- Check .env file exist -->
|
||||
|
||||
1. Run the project
|
||||
|
||||
```
|
||||
yarn build
|
||||
yarn dev
|
||||
```
|
||||
|
||||
<!-- Check ./config/ssh_key.pub is a file not a folder -->
|
||||
|
||||
Enjoy!
|
||||
Reference in new issue
Block a user