Skip to content

Merge main into staging #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dockerfile to build the validmind-docs image

# Use the official Nginx image
FROM nginx:alpine

# Copy the static site content to the Nginx HTML directory
COPY site/_site /usr/share/nginx/html

# Expose port 4444
EXPOSE 4444

# Nginx starts automatically as the default CMD
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,33 @@ After you pull in the changes, commit them to this repo as part of the release n
<!-- September 16, 2024: Need to mention rendered Python `.html` docs and generated `.md` test descriptions -->

<!-- Testing conditional changes on site/notebooks/ -->

## Build and serve the site with Docker

You can build and serve the static HTML docs site using Docker — for deployment as part of our product or for testing in a consistent local environment.

### Prerequisites

- [Docker](https://docs.docker.com/get-docker/)

### Build the site

```bash
cd site
make docker-build
```

This command:

1. Gets all the source files.
2. Renders the static site in `site/_site`.
3. Builds a Docker image using the `Dockerfile`.

### Serve the site

```bash
cd site
make docker-serve
```

Access the site locally: http://localhost:4444
17 changes: 14 additions & 3 deletions site/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PROFILE := exe-demo
FILE_PATH := notebooks/tutorials/intro_for_model_developers_EXECUTED.ipynb

# Define .PHONY target for help section
.PHONY: help clean clone notebooks python-docs docs-site deploy-demo deploy-demo-branch delete-demo-branch deploy-prod deploy-staging release-notes execute
.PHONY: help clean clone notebooks python-docs docs-site deploy-demo deploy-demo-branch delete-demo-branch deploy-prod deploy-staging release-notes execute docker-build docker-serve

# Help section
help:
Expand All @@ -27,6 +27,8 @@ help:
@echo " help Display this help message (default target)"
@echo " release-notes Generate release notes from pull requests since latest tag and update _quarto.yml"
@echo " execute Execute a Jupyter Notebook (must have valid .env credentials set up in root)"
@echo " docker-build Builds a Docker image of the docs site"
@echo " docker-serve Serves the docs site at http://localhost:4444/"

# Clean up source directory
clean:
Expand Down Expand Up @@ -82,8 +84,9 @@ test-descriptions:
get-source: clean clone notebooks python-docs test-descriptions

# Get all source files
docs-site: clean clone notebooks python-docs test-descriptions
quarto render --profile development
docs-site: get-source
@echo "\nRendering the static HTML site ..."
quarto render --profile production

# Deployment to https://docs-demo.vm.validmind.ai/
deploy-demo:
Expand Down Expand Up @@ -131,3 +134,11 @@ release-notes:
# To override: make execute PROFILE=select-profile FILE_PATH=notebooks/notebook-path-here.ipynb
execute:
quarto render --profile $(PROFILE) $(FILE_PATH)

docker-build: docs-site
@echo "\nBuilding the Docker image ..."
@docker build -f ../Dockerfile -t validmind-docs ..

docker-serve:
@echo "\nStarting the Docker container on http://localhost:4444/ ..."
@docker run -p 4444:80 validmind-docs
Loading