Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.
Open
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text eol=lf
* text=auto eol=lf
33 changes: 12 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
# Dockerfile

## Build
# Development stage
FROM node:24.10.0-alpine3.22 AS builder

WORKDIR /app

# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
RUN npm install --no-fund

# Copy source code
COPY . ./

# Build stage (for production)
FROM builder AS build
RUN npm run build


## Clean
FROM nginx:alpine AS cleaner

WORKDIR /usr/share/nginx/html

RUN rm -rf ./*

COPY --from=builder /app/dist/ ./
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf


## Release/production
FROM nginxinc/nginx-unprivileged:1.29-alpine3.22-perl AS release
# Production stage with nginx
FROM nginxinc/nginx-unprivileged:1.29-alpine3.22-perl AS production

LABEL maintainer=courseproduction@bcit.ca

WORKDIR /usr/share/nginx/html
# Copy built files and nginx config
COPY --from=build /app/dist/ /usr/share/nginx/html/
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf

COPY --from=cleaner /usr/share/nginx/html/ ./
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080
86 changes: 81 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,89 @@ This is an online reference for anybody that develops, produces, or maintains an

## Development

**Requirements**: Docker, NodeJS
**Requirements**: Node.js 24+ (or Docker)

> **Modernized**: This project has been modernized from Gulp to Vite for faster development and better performance.

### Local Development

```bash
npm install
npm run dev
```

This will start the Vite dev server at `http://localhost:3000` with hot module replacement.

### Production Build

```bash
npm run build
```

This creates optimized production files in the `dist/` directory with gzip and Brotli compression.

### Preview Production Build

```bash
npm run preview
```

This serves the production build locally at `http://localhost:4173` for testing.

## Docker Development

### Development with Docker

```bash
docker-compose -f docker-compose.dev.yml up --build
```

This runs the Vite dev server in a container with hot module replacement at `http://localhost:3000`.

### Production with Docker

```bash
docker-compose up --build
```

This creates an optimized production build served by nginx at `http://localhost:8080`.

## Project Structure

```
├── src/
│ ├── pages/ # HTML entry points
│ ├── partials/ # HTML includes and components
│ ├── scss/ # SCSS stylesheets
│ └── js/ # JavaScript modules
├── public/
│ └── assets/ # Static assets
├── dist/ # Production build output
└── vite.config.js # Vite configuration
```

## Features

- **Modern Build System**: Vite for fast development and optimized production builds
- **Multi-page Application**: Support for multiple HTML entry points
- **Custom Plugins**: HTML includes (`@@include()`) and partial processing
- **SCSS Support**: Native Sass preprocessing with modern `@use` syntax
- **Compression**: Automatic gzip and Brotli compression for production
- **Docker Support**: Both development and production containers
- **Hot Module Replacement**: Instant updates during development
- **Clean URLs**: SEO-friendly routing without file extensions

## Troubleshooting

**Port already in use:**
```bash
docker compose up --build
npx kill-port 3000
```

If you encounter an error, consider the following:
**Docker build fails:**
- Ensure Docker is running
- Try rebuilding with `--no-cache`: `docker-compose up --build --no-cache`

* Ensure Node.js (and npm) are installed on your computer
* Ensure you run the command from the project root (same folder as package.json)
**Missing styles after Docker rebuild:**
- Ensure HTML files reference `/css/page-setup.css` (not SCSS source)
- Check that `src/js/page-setup.js` imports the main SCSS file
184 changes: 0 additions & 184 deletions css/hotspot.css

This file was deleted.

2 changes: 0 additions & 2 deletions css/styles.css

This file was deleted.

13 changes: 13 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
app:
build:
context: .
target: builder
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
command: npm run dev
10 changes: 3 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ services:
image: conversion-guide
build:
context: .
target: release
# command: npm run watch
environment:
- DEBUG=True
working_dir: /app
# volumes:
# - .:/app
target: production
ports:
- "8080:8080"
environment:
- NODE_ENV=production
Loading