Add description for native setup on macOS

This commit is contained in:
Sebastian Serth
2019-12-20 16:11:19 +01:00
parent fdde3925c4
commit 3f25313f48

View File

@ -64,3 +64,97 @@ rails s -p 3000 -b 0.0.0.0
### Login to CodeOcean
192.168.59.104:3000
admin@example.org:admin
## Native setup (for macOS)
- Clone this repository:
```shell script
git clone git@github.com:openHPI/codeocean.git
```
- Install PostgreSQL, start it and create a generic postgres user:
```shell script
brew install postgresql
brew services start postgresql
createuser -s -r postgres
```
- Install [NVM](https://github.com/creationix/nvm) and node:
```shell script
brew install nvm
mkdir ~/.nvm
nvm install --lts
```
- Add the following lines to your profile. (e.g., `~/.zshrc`):
```shell script
# NVM
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
```
- Install yarn:
```shell script
brew install yarn --ignore-dependencies
```
- Install docker:
```shell script
brew install docker
open /Applications/Docker.app/
```
- Install nginx and adopt its config to forward requests to the **RAW** docker UNIX socket (see [this issue](https://github.com/docker/for-mac/issues/1662) for more details):
```shell script
brew install nginx
```
Edit `/usr/local/etc/nginx/nginx.conf`:
1. Change the default port `8080` to `2376` (around line 36).
2. Replace the `location /` with the following and (!) replace `<yourname>` with the output of `whoami`:
```editorconfig
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://unix:/Usrers/<yourname>/Library/Containers/com.docker.docker/Data/docker.raw.sock;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
```
Now, start nginx:
```shell script
brew services start nginx
```
- Install RVM and bundler:
```shell script
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --rails
gem install bundler
```
- Install geckodriver and Firefox for Selenium:
```shell script
brew install geckodriver
brew cask install firefox
```
- Get a local copy of the config files:
```shell script
for f in action_mailer.yml database.yml secrets.yml sendmail.yml smtp.yml code_ocean.yml docker.yml.erb mnemosyne.yml
do
if [ ! -f config/$f ]
then
cp config/$f.example config/$f
fi
done
```
- Install gems and yarn files:
```shell script
bundle install
yarn install
```
- Setup your database:
```shell script
rake db:create
rake db:schema:load
rake db:migrate
rake db:seed
```