Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 35 additions & 24 deletions pages/vi/vi-docker-development-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,52 @@ Next, run `ng version` to check your Angular CLI version, look for `Angular CLI:

## Container Setup

### Linux
**Note**: For linux systems, you may need to run the commands with `sudo` if you encounter permission issues.

1. Create a `planetdev` directory for the planet dev data:

```bash
sudo mkdir -p /srv/planetdev && cd /srv/planetdev
mkdir -p /srv/planetdev && cd /srv/planetdev
```

2. Download the development yml file:
2. Create a `planet-dev.yml` file and copy the content below into the file:

```bash
sudo wget https://raw.githubusercontent.com/ole-vi/planet-prod-configs/main/planet-dev.yml
```

3. Start the containers: `sudo docker compose -f planet-dev.yml -p planet-dev up -d`
4. After a minute, run `sudo docker ps -a` to verify that you have 2 runnning containers – `chatapi` and `couchdb`, the `db-init` container should have exited.
- If `chatapi` service is restarting or exited, please ignore it for now as we are working on a fix

### macOS/Windows

1. Create a `planetdev` directory for the planet dev data:

```bash
mkdir -p ~/srv/planetdev && cd ~/srv/planetdev
```

2. Download the development yml file:

```bash
curl https://gist.githubusercontent.com/xyb994/0d14dfe302df0df0d4e8d8df0d1d5feb/raw/planet-dev-mac.yml -o planet-dev.yml
services:
couchdb:
expose:
- 5984
image: treehouses/couchdb:2.3.1
ports:
- "2200:5984"
volumes:
- "~/srv/planetdev/conf:/opt/couchdb/etc/local.d"
- "~/srv/planetdev/data:/opt/couchdb/data"
- "~/srv/planetdev/log:/opt/couchdb/var/log"
chatapi:
image: treehouses/planet:chatapi
depends_on:
- couchdb
ports:
- "5400:5400"
environment:
- COUCHDB_HOST=http://couchdb:5984
#- COUCHDB_USER=planet
#- COUCHDB_PASS=planet
- SERVE_PORT=5400
db-init:
image: treehouses/planet:db-init
depends_on:
- couchdb
environment:
- COUCHDB_HOST=http://couchdb:5984
#- COUCHDB_USER=planet
#- COUCHDB_PASS=planet
```

3. Start the containers: `docker compose -f planet-dev.yml -p planet-dev up -d`
4. After a minute, run `docker ps -a` to verify that you have 2 runnning containers – `chatapi` and `couchdb`, the `db-init` container should have exited.
- If `chatapi` service is restarting or exited, please ignore it for now as we are working on a fix
- If `chatapi` service is restarting or exited, please ignore it for now.

## Configure CORS for CouchDB with add-cors-to-couchdb project:

Expand Down Expand Up @@ -169,7 +180,7 @@ Install dependecies and serve the app
||**production**|**development**|
|---|--------------|---------------|
| *planet* | 3300 | 3000 |
| *chatapi* | 5050 | 5000 (5400 for mac/windows) |
| *chatapi* | 5050 | 5400 |
| *couchdb* | 2300 | 2200 |

---
Expand Down