Skip to content
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

Simplify Docker setup and update documentation #16

Merged
merged 4 commits into from
Feb 9, 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
13 changes: 1 addition & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Use Python 3.10.11 image as the base
FROM python:3.10-slim-bullseye

# Set the working directory
FROM python:3.10-alpine
WORKDIR /app

# Copy the current directory to the container
COPY . /app

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose port 8000
EXPOSE 8000

# Start mkdocs dev server
CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"]
73 changes: 54 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,98 @@
# HackforLA.org Wiki

This repository houses the documentation for the Hack for LA website team. The live site is available at [https://hackforla.github.io/website-wiki/](https://hackforla.github.io/website-wiki/). The documentation is built using [MkDocs](https://www.mkdocs.org/) and is styled with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme.
This repository houses the documentation for Hack for LA's website team. The documentation is built using [MkDocs](https://www.mkdocs.org/) and is styled with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme.

**Note**: Issues related to this wiki are tracked in the [hackforla/website repository](https://github.com/hackforla/website). For more information on the current state of the wiki, please refer to the [How to Contribute to the Wiki](https://github.com/hackforla/website/wiki/How-to-Contribute-to-the-Wiki) page.
**Note**: Issues related to this wiki are tracked in the [hackforla/website repository](https://github.com/hackforla/website).

For more information on the current state of the wiki, please refer to the [How to Contribute to the Wiki](https://github.com/hackforla/website/wiki/How-to-Contribute-to-the-Wiki) page.

---

## Getting Started

### Clone or Fork the Repository

Clone your fork or the original repository locally:

```bash
git clone https://github.com/YOUR_USERNAME/website-wiki.git
```

```bash
cd website-wiki
```

## Installation

### With Docker

1. **Pull the Docker Image**: To ensure you have the latest Docker image, run:
The easiest way to get your local mkdocs server running and see your changes in real-time is by using Docker Compose.

1. **Start the mkdocs Server**

To serve your site locally, run:

```bash
docker pull vraer/hfla-website-wiki:latest
docker-compose up
```

2. **Start the Development Server**: To start the development server, run:

This launches the mkdocs server, which serves your documentation site and listens for changes. Your site will automatically update as you make changes to the documentation.

If you prefer to run the server in the background, use:

```bash
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs vraer/hfla-website-wiki:latest
docker-compose up -d
```

Your site will now be accessible at <http://localhost:8000>.
2. **View Your Site**

#### Building the Documentation
Open a web browser and go to `http://localhost:8000` to see your mkdocs site live.

To build the documentation into a `site` folder, run:
3. **Stop the Server**

To stop the server, if running in the foreground, press `Ctrl+C` in your terminal. For detached mode, use:

```bash
docker-compose down
```

```bash
docker run --rm -it -v ${PWD}:/docs vraer/hfla-website-wiki:latest build
```

### With Python virtualenv

**Note for Windows Users Installing Python:**

During the Python installation process, make sure to select the option **"Add Python 3.x to PATH"**. This step will allow you to run Python and pip commands from the Command Prompt.

1. **Create a Virtual Environment**:

```python
For macOS/Linux:

```bash
python3 -m venv venv
```

For Windows:

```cmd
python -m venv venv
```

2. **Activate the Virtual Environment**:

For macOS/Linux:

```bash
source venv/bin/activate
```

For Windows:

```cmd
.\venv\Scripts\activate
```

3. **Install Required Packages**:

```bash
pip install -r requirements.txt
pip install -r requirements.txt
```

4. **Start the Development Server**:
Expand All @@ -69,11 +101,14 @@ docker run --rm -it -v ${PWD}:/docs vraer/hfla-website-wiki:latest build
mkdocs serve
```

Your site will now be accessible at <http://localhost:8000>.

5. **Build the Documentation**:

Building the mkdocs site generates static HTML files. This step is typically reserved for testing custom hooks or preparing the documentation for deployment.

```bash
mkdocs build
```

Your site will now be accessible at <http://localhost:8000>.

This compiles your Markdown files into static HTML files, placing them in the `site` directory.
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.8'
services:
mkdocs:
build: .
ports:
- "8000:8000"
volumes:
- .:/app
command: mkdocs serve --dev-addr=0.0.0.0:8000
8 changes: 4 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ plugins:
minify_html: true
- search: {}
- autolinks: {}
- git-revision-date-localized: {}
# - git-revision-date-localized: {}

markdown_extensions:
- abbr
Expand All @@ -80,7 +80,8 @@ markdown_extensions:
- toc:
title: On this page
permalink: "#"
- pymdownx.betterem
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
Expand All @@ -90,8 +91,7 @@ markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink:
hide_protocol: false
normalize_issue_symbols: false
normalize_issue_symbols: true
user: hackforla
provider: github
repo: website
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ markdown>=3.2
mkdocs>=1.5.0
mkdocs-autolinks-plugin==0.7.1
mkdocs-awesome-pages-plugin
mkdocs-git-revision-date-localized-plugin==1.2.0
mkdocs-material>=9.0.0,<10.0.0
mkdocs-material-extensions>=1.1
mkdocs-minify-plugin
Expand Down