Skip to content

Commit b4f5c2d

Browse files
committedMar 21, 2024·
Update docs to not imply the MkDocs dev-server will start automatically
1 parent f2690e8 commit b4f5c2d

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed
 

‎DEVELOPMENT.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ graph BT
1616
host_terminal["Terminal<br>(You are here)"]
1717
1818
subgraph app_container["Container running `app` service"]
19-
mkdocs_server["MkDocs dev-server"]
19+
mkdocs_server["MkDocs dev-server<br>(if running)"]
2020
app_bash["bash shell"]
2121
end
2222
@@ -78,7 +78,8 @@ Here's how you can instantiate the development environment on your computer.
7878
```shell
7979
docker compose exec app bash
8080
```
81-
> You can think of this as "`ssh`-ing" into a Linux system. In this case, the Linux system is a Docker container running on your computer, and you are using something other than `ssh` to communicate with it.
81+
> You can think of this as "`ssh`-ing" into a Linux system. In this case, the Linux system is a Docker container
82+
> running on your computer, and you are using something other than `ssh` to communicate with it.
8283
3. (Optional) Explore that container!
8384
```shell
8485
$ whoami
@@ -99,20 +100,29 @@ Here's how you can instantiate the development environment on your computer.
99100
```shell
100101
$ make gendoc
101102
```
102-
5. (Optional) Visit the MkDocs dev-server.
103+
5. (Optional) Start the MkDocs dev-server.
104+
```shell
105+
$ poetry run mkdocs serve --dev-addr 0.0.0.0:8000
106+
```
107+
> The `0.0.0.0` part is necessary in order to be able to access the MkDocs dev-server
108+
> [from your Docker host](https://github.com/mkdocs/mkdocs/issues/1239#issuecomment-354491734)
109+
> (i.e. from outside the container). By default, the MkDocs dev-server only listens for requests coming from the
110+
> [same computer](https://github.com/mkdocs/mkdocs/issues/2108) that is running the MkDocs dev-server
111+
> (i.e. coming from inside the container).
112+
6. (Optional) Visit the MkDocs dev-server.
103113
- In your web browser, visit http://localhost:8000
104114
> Note: If you customized `DOCS_PORT` earlier, use that port number instead of `8000` here.
105-
6. Use the container running the `app` service, as your `nmdc-schema` development environment.
115+
7. Use the container running the `app` service, as your `nmdc-schema` development environment.
106116
```shell
107117
$ poetry install
108118
$ make squeaky-clean
109119
$ poetry shell
110120
# etc.
111121
```
112-
7. (Optional) Visit the Fuseki web server.
122+
8. (Optional) Visit the Fuseki web server.
113123
- In your web browser, visit http://localhost:3030
114124
> Note: If you customized `FUSEKI_PORT` earlier, use that port number instead of `3030` here.
115-
8. (Optional) Done working on this project (e.g. for the day)? Stop the containers.
125+
9. (Optional) Done working on this project (e.g. for the day)? Stop the containers.
116126
```shell
117127
docker compose down
118128
```

‎Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ RUN pip install poetry
5454
# Install the project's Python dependencies.
5555
ADD ./poetry.lock /nmdc-schema/poetry.lock
5656
ADD ./pyproject.toml /nmdc-schema/pyproject.toml
57+
# TODO: Re-enable this as part of https://github.com/microbiomedata/nmdc-schema/issues/1744
5758
# RUN poetry install
5859

5960
# Configure the container to display a welcome message and the OS name whenever
@@ -64,8 +65,5 @@ RUN echo "echo \" Welcome to this nmdc-schema development container,\""
6465
RUN echo "echo \" which is running \${OS_NAME}\"." >> /etc/bash.bashrc
6566
RUN echo "echo \"\"" >> /etc/bash.bashrc
6667

67-
# Run the MkDocs dev-server, configuring it to accept HTTP requests from outside the container.
68-
# Reference: https://github.com/mkdocs/mkdocs/issues/1239#issuecomment-354491734
69-
#CMD ["poetry", "run", "mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]
70-
# launching mkdocs server had been ok on MacOS but not Ubuntu. Now this step is giving "mkdocs not installed" even in MacOS
71-
CMD ["tail", "-f", "/dev/null"]
68+
# Run a "no-op" command that will keep the container running.
69+
CMD ["tail", "-f", "/dev/null"]

0 commit comments

Comments
 (0)
Please sign in to comment.