Skip to content

Commit a72e6dc

Browse files
authored
update vi-docker-tutorial.md and vi-planet-configurations.md (fixes #3370) (#3374)
1 parent aa703af commit a72e6dc

File tree

2 files changed

+42
-34
lines changed

2 files changed

+42
-34
lines changed

pages/vi/vi-docker-tutorial.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,28 @@ docker tag treehouses/planet:db-init treehouses/planet:db-init-local
5858
docker tag treehouses/planet:chatapi treehouses/planet:chatapi-local
5959

6060
# create a dedicated directory
61-
# for mapping Docker container volumes and configuring environment variables
61+
# for mapping Docker container volumes and saving configuration files
6262
sudo mkdir /srv/planet
6363
cd /srv/planet
6464

65-
# we are putting "DUMMYAPIKEY" here for now
66-
# when you work on related features, we will assign you the keys
67-
echo "OPENAI_API_KEY=DUMMYAPIKEY" > .chat.env
68-
echo "PERPLEXITY_API_KEY=DUMMYAPIKEY" >> .chat.env
69-
7065
# download production docker compose yml file and rename it
7166
wget https://raw.githubusercontent.com/ole-vi/planet-prod-configs/main/planet-prod.yml
7267
mv planet-prod.yml planet.yml
7368

69+
# download the planet docker helper bash script
70+
wget https://raw.githubusercontent.com/ole-vi/planet-prod-configs/refs/heads/main/planet.sh
71+
7472
# starts the containers in the background
75-
# with compose configuration file planet.yml and leaves them running
76-
docker compose -f planet.yml -p planet up -d --build
73+
bash planet.sh up
7774

7875
# see if the docker containers are running
7976
# ensure it says "Up" in STATUS column
8077
# with the exception of db-init, which may finished running and exited already
78+
# if chatapi service is restarting or exited, please ignore it for now as we are working on a fix
8179
docker container ls -a
8280

8381
# follow the log in action, press 'control+c' to exit the logs view
84-
docker compose -f planet.yml -p planet logs -f
82+
docker compose -p planet logs -f
8583
```
8684

8785
## macOS/Windows - Run Planet Community with Docker
@@ -106,29 +104,27 @@ docker tag treehouses/planet:db-init treehouses/planet:db-init-local
106104
docker tag treehouses/planet:chatapi treehouses/planet:chatapi-local
107105

108106
# create a dedicated directory
109-
# for mapping Docker container volumes and configuring environment variables
107+
# for mapping Docker container volumes and saving configuration files
110108
mkdir -p ~/srv/planet
111109
cd ~/srv/planet
112110

113-
# we are putting "DUMMYAPIKEY" here for now
114-
# when you work on related features, we will assign you the keys
115-
echo "OPENAI_API_KEY=DUMMYAPIKEY" > .chat.env
116-
echo "PERPLEXITY_API_KEY=DUMMYAPIKEY" >> .chat.env
117-
118-
# download docker compose yml file
111+
# download the planet docker compose yml file
119112
curl https://gist.githubusercontent.com/xyb994/da04da73f903757d71d8a56780edcfcc/raw/planet-so-mac.yml -o planet.yml
120113

114+
# download the planet helper bash script
115+
curl https://gist.githubusercontent.com/xyb994/5760570db3dd4defe580e8bfff9a4bea/raw/planet.sh -o planet.sh
116+
121117
# starts the containers in the background
122-
# with compose configuration file planet.yml and leaves them running
123-
docker compose -f planet.yml -p planet up -d --build
118+
bash planet.sh up
124119

125-
# see if the docker containers are running
126-
# ensure it says "Up" in STATUS column
120+
# see if the docker containers are running, you may also do this in the docker desktop app
121+
# ensure it says "Up" or "Running" in the status column
127122
# with the exception of db-init, which may finished running and exited already
123+
# if chatapi service is restarting or exited, please ignore it for now as we are working on a fix
128124
docker container ls -a
129125

130126
# follow the log in action, press 'control+c' to exit the logs view
131-
docker compose -f planet.yml -p planet logs -f
127+
docker compose -p planet logs -f
132128
```
133129

134130
## Services and Ports
@@ -155,18 +151,30 @@ Here are a few common Docker CLI commands you might need when working with `plan
155151
- `docker logs <container-id> -f` – Follow the log output of a container.
156152
- `docker images` – List images.
157153

158-
Here are some common Docker Compose commands you might need when working with `planet`. The following examples assume you are in the planet repository's docker folder:
154+
Here are some common Docker Compose commands:
159155

160-
- `docker compose -f planet.yml -p planet up -d --build` – Spawn your environment for the *first time*.
156+
- `docker compose -f <YAMLFile1> -f <YAMLFile2> -p <ProjectName> up -d --build` – Spawn your environment for the *first time*.
161157
- `-f` – Specify an alternate compose file (default: docker-compose.yml).
162158
- `-p` – Specify a project name (default: directory name).
163159
- `up -d` – Create and start containers in the background.
164160
- `--build` – Build images before starting containers
165-
- `docker compose -f planet.yml -p planet logs -f` – Follow the log output. Press 'CTRL+C' to exit logs view.
166-
- `docker compose -f planet.yml -p planet restart` – Restart `planet`.
167-
- `docker compose -f planet.yml -p planet stop` – Stop `planet` without removing it.
168-
- `docker compose -f planet.yml -p planet start` – Start `planet` again.
169-
- `docker compose -f planet.yml -p planet down -v` – Stop containers and remove containers, networks, volumes, and images created.
161+
- `docker compose -f <YAMLFile> -p <ProjectName> logs -f` – Follow the log output. Press 'CTRL+C' to exit logs view.
162+
- `docker compose -f <YAMLFile> -p <ProjectName> restart` – Restart the project.
163+
- `docker compose -f <YAMLFile> -p <ProjectName> stop` – Stop the project without removing it.
164+
- `docker compose -f <YAMLFile> -p <ProjectName> start` – Start the project again.
165+
- `docker compose -f <YAMLFile> -p <ProjectName> down -v` – Stop containers and remove containers, networks, volumes, and images created.
166+
167+
**Note: For Docker Compose commands, use the `planet.sh` script** to avoid specifying the YAML file path and project name each time. The script also checks for the credentials YAML file and merges it for CouchDB to function properly. This credentials file is generated after setting up an admin account in the Planet web interface during initial configuration.
168+
169+
```plaintext
170+
Usage: planet.sh <up|stop|start|restart|down|(other docker compose command)...>
171+
172+
Example: planet.sh up Start up the planet services for the first time in the background.
173+
planet.sh stop Stop planet services.
174+
planet.sh start Start planet services.
175+
planet.sh restart Restart planet services.
176+
planet.sh down Stop planet services and remove containers, networks, volumes, and images created.
177+
```
170178

171179
We suggest referring to the [Docker CLI reference](https://docs.docker.com/engine/reference/commandline/cli/) and the [Docker Compose CLI reference](https://docs.docker.com/compose/reference/) to learn more about their commands and usage.
172180

pages/vi/vi-planet-configurations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ Visit [http://localhost:3300](http://localhost:3300) or [http://127.0.0.1:3300](
3939
- **macOS:** `cd ~/srv/planet`
4040
- **Windows:** `cd ~/srv/planet`
4141

42-
3. Run `docker compose -f planet.yml -p planet start` to start the service.
42+
3. Run `bash planet.sh start` to start the service.
4343

4444
## Configure Your Planet Community
4545

4646
Visit the initial admin configuration page by navigating to [http://localhost:3300](http://localhost:3300) or [http://127.0.0.1:3300](http://127.0.0.1:3300). **Use `planet` as both the username and password**, as specified in the Docker Compose YAML file from the previous step.
4747

4848
![Become an Administrator](images/vi-become-admin.png)
4949

50-
**WARNING:** Do not close this browser tab before completing the configuration, as you cannot return to this form. If you accidentally close the tab, run `docker compose -f planet.yml -p planet down -v` followed by `docker compose -f planet.yml -p planet up -d --build` to restart the process.
50+
**WARNING:** Do not close this browser tab before completing the configuration, as you cannot return to this form. If you accidentally close the tab, run `bash planet.sh down` followed by `bash planet.sh up` to restart the process.
5151

5252
Fill out the configurations, ensuring your name matches your GitHub name for easy identification in Virtual Intern Nation. Select **Virtual Intern Nation (vi)** as the nation, as shown below. **After completing the configurations, save a screenshot of the page to post on the Discord server after submitting your registration request.**
5353

@@ -92,17 +92,17 @@ Finally, post the screenshot you took earlier to [our Discord server's #vi-softw
9292
To restart the containers, use
9393

9494
```bash
95-
docker compose -f planet.yml -p planet restart
95+
bash planet.sh restart
9696
```
9797

9898
or
9999

100100
```bash
101101
# Stop `planet` without removing it
102-
docker compose -f planet.yml -p planet stop
102+
bash planet.sh stop
103103

104104
# Start `planet` again
105-
docker compose -f planet.yml -p planet start
105+
bash planet.sh start
106106
```
107107

108108
### Starting Over
@@ -112,7 +112,7 @@ docker compose -f planet.yml -p planet start
112112
```bash
113113
# 1. Stop and remove containers, networks, volumes, and images
114114
# created with the `planet.yml` configuration file
115-
docker compose -f planet.yml -p planet down -v
115+
bash planet.sh down
116116

117117
# 2. Remove the planet folder you created in the previous step
118118
# Linux

0 commit comments

Comments
 (0)