|
11 | 11 | - [**Prerequisites**](#prerequisites)
|
12 | 12 | - [**Setup Instructions**](#setup-instructions)
|
13 | 13 | - [1. Fork and Clone this repository](#1-fork-and-clone-this-repository)
|
14 |
| - - [2. Install Dependencies](#2-install-dependencies) |
15 |
| - - [3. Docker Setup](#3-docker-setup) |
16 |
| - - [4. Starting Docker](#4-starting-docker) |
17 |
| - - [5. Stopping Docker](#5-stopping-docker) |
18 |
| - - [Docker Notes](#docker-notes) |
| 14 | + - [2. Starting the Development Environment](#2-starting-the-development-environment) |
| 15 | + - [3. Stopping Docker](#3-stopping-docker) |
| 16 | + - [4. Development Workflow](#4-development-workflow) |
| 17 | + - [Docker Development Notes](#docker-development-notes) |
19 | 18 | - [**Working on issues**](#working-on-issues)
|
20 | 19 | - [**Branch Workflow**](#branch-workflow)
|
21 | 20 | - [**Create an issue**](#create-an-issue)
|
|
67 | 66 | upstream https://github.com/hackforla/internship-website-design-system.git (push)
|
68 | 67 | ```
|
69 | 68 |
|
70 |
| -#### 1. **Docker Setup** |
71 |
| -- #### **Enter repo directory:** |
| 69 | +#### 2. **Starting the Development Environment** |
| 70 | + |
| 71 | +**IMPORTANT:** Make sure **Docker Desktop** is running on your computer before executing the commands below. |
| 72 | + |
| 73 | +- #### **Navigate to the project directory:** |
72 | 74 | ```bash
|
73 | 75 | cd internship-website-design-system
|
74 | 76 | ```
|
75 |
| -- #### **Build the Docker image:** |
76 |
| - ```bash |
77 |
| - docker build -t ds . |
| 77 | + |
| 78 | +- #### **Start the development environment:** |
| 79 | + ```bash |
| 80 | + docker compose up |
78 | 81 | ```
|
79 |
| - This command builds a Docker image named `ds` from the Dockerfile in the current directory. |
80 |
| - Note: If you have a permissions error run `sudo docker build -t ds .` and enter your machine's admin password. |
| 82 | + This command will: |
| 83 | + - Build the Docker image automatically |
| 84 | + - Install all npm dependencies |
| 85 | + - Compile Sass files initially |
| 86 | + - Start the Sass watcher for live CSS compilation |
| 87 | + - Start MkDocs server with live reload |
| 88 | + - Set up file watching for automatic updates |
| 89 | + |
| 90 | +- #### **View the site:** |
| 91 | + Open your browser and navigate to: **http://localhost:8000** |
81 | 92 |
|
82 |
| -#### 2. **Starting Docker** |
83 |
| -**IMPORTANT:** Please make sure the `Docker Desktop` application is **running on your computer** before you run the bash commands below. |
84 |
| -- #### Run the Docker container. |
| 93 | + Both Sass changes and documentation changes will automatically reload in your browser. |
| 94 | + |
| 95 | +- #### **Alternative Docker Commands:** |
85 | 96 | ```bash
|
86 |
| - docker run -p 8000:8000 -v $(pwd):/docs ds |
| 97 | + # Start in background (detached mode) |
| 98 | + docker compose up -d |
| 99 | + |
| 100 | + # Build fresh and start |
| 101 | + docker compose up --build |
| 102 | + |
| 103 | + # View logs while running in background |
| 104 | + docker compose logs -f |
| 105 | + |
| 106 | + # Check container status |
| 107 | + docker compose ps |
87 | 108 | ```
|
88 |
| - This command runs the `ds` image as a container and maps the container's port 8000 to port 8000 on your host machine, allowing you to access the MkDocs server. View the site by navigating to `[http://localhost:8000](http://0.0.0.0:8000/internship-website-design-system/)` in your web browser. You should see your MkDocs site being served from the Docker container. |
89 | 109 |
|
90 |
| -#### 5. **Stopping Docker** |
91 |
| -Simply press `CTRL + C` in the terminal where the container is running. This sends a SIGINT signal, initiating a graceful shutdown of the container. If it doesn't stop, pressing `CTRL + C` again forces a more abrupt termination. |
| 110 | +#### 3. **Stopping Docker** |
| 111 | +- **If running in foreground:** Press `Ctrl + C` in the terminal |
| 112 | +- **If running in background:** Run `docker compose down` |
92 | 113 |
|
93 |
| -#### Docker Notes: |
| 114 | +#### 4. **Development Workflow** |
| 115 | + |
| 116 | +1. **Edit Sass files** in `docs/components/sass/` |
| 117 | +2. **Changes auto-compile** and browser refreshes automatically |
| 118 | +3. **Edit documentation** in `docs/*.md` files |
| 119 | +4. **Changes auto-reload** in the browser |
| 120 | + |
| 121 | +#### Docker Development Notes: |
94 | 122 |
|
95 |
| -- Changes to any files will automatically be displayed in your browser if the Docker image is ran with `docker run -p 8000:8000 -v $(pwd):/docs ds` as previously mentioned. |
96 |
| -- If the default port (8000) is already in use on your machine, you can map the container's port to a different port on your host machine by changing the first `8000` in the `docker run` command to a free port, e.g., `docker run -p 8001:8000 ds`. |
| 123 | +- **Live reload works for both CSS and documentation** - no manual refresh needed |
| 124 | +- **File changes are instant** - the container watches your local files |
| 125 | +- **Port 8000** serves the MkDocs site, **port 35729** handles live reload |
| 126 | +- **If port 8000 is busy:** Stop other services using that port or change the port mapping in `docker-compose.yml` |
| 127 | +- **Container commands:** If you need to run commands inside the container: |
| 128 | + ```bash |
| 129 | + # Access container shell |
| 130 | + docker compose exec mkdocs sh |
| 131 | + |
| 132 | + # Inside container you can run: |
| 133 | + npm run dev # Start only Sass watcher |
| 134 | + npm run build-sass # Build Sass once |
| 135 | + npm run clean # Clean compiled CSS |
| 136 | + ``` |
97 | 137 |
|
98 | 138 | ## Working on issues
|
99 | 139 |
|
@@ -145,7 +185,7 @@ After pushing your branch to your fork, navigate to the [original repository](ht
|
145 | 185 | ## Testing
|
146 | 186 | <!-- Talk about Accessibility Testing -->
|
147 | 187 |
|
148 |
| -- Run and view the site locally. See [Starting Docker](#3-starting-docker) |
| 188 | +- Run and view the site locally. See [Starting the Development Environment](#2-starting-the-development-environment) |
149 | 189 | - Observe visual changes for desktop-sized screens as well as mobile.
|
150 | 190 |
|
151 | 191 | ### Automated Accessibility Testing
|
|
0 commit comments