Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f9c68b0
Initial commit
winstonwumbo Sep 5, 2025
d89ce2d
Created Dockerfiles for simple hosting and devenv
winstonwumbo Sep 15, 2025
4878467
Added sample GitHub Action to build off from
winstonwumbo Sep 15, 2025
de08e85
Merge remote-tracking branch 'origin/main' into import-hax-docker
AndrewGearhart Sep 18, 2025
0052d18
Switch to ubuntu:22.04-slim for reproducibility and smaller image siz…
AndrewGearhart Sep 18, 2025
ffbb739
Add ubuntu user creation and fix permissions (fixes #2)
AndrewGearhart Sep 18, 2025
1f0a793
Consolidate Dockerfile logic and implement multi-stage builds for sta…
AndrewGearhart Sep 18, 2025
78e9542
Clean up package manager caches in build steps (fixes #5)
AndrewGearhart Sep 18, 2025
e358467
Deprecate Dockerfile.devenv and point to consolidated multi-stage Doc…
AndrewGearhart Sep 18, 2025
057ffe5
Add .dockerignore file to exclude unnecessary, OS, and editor files f…
AndrewGearhart Sep 18, 2025
44968d6
Rename services to 'simplehost' and 'devenv', add comments for clarit…
AndrewGearhart Sep 18, 2025
19fe098
Add container_name to each service in docker-compose.yml for easier m…
AndrewGearhart Sep 18, 2025
6b13716
Add named volumes for persistent data to both services in docker-comp…
AndrewGearhart Sep 18, 2025
84ed8d4
Expand README with usage instructions, prerequisites, and example com…
AndrewGearhart Sep 18, 2025
084cedf
Remove the extra dockerfile
AndrewGearhart Sep 18, 2025
71c9252
Removed old hax-docker name from README header
winstonwumbo Sep 18, 2025
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
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ignore node_modules, git, logs, and other local/development artifacts
node_modules/
.git/
*.log
Dockerfiles/Dockerfile.devenv
.vscode/
.env
__pycache__/
*.pyc
*.swp
# macOS and OS-specific files
.DS_Store
.AppleDouble
.LSOverride
Icon?
._*
Thumbs.db
ehthumbs.db
Desktop.ini
18 changes: 18 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v5
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
30 changes: 30 additions & 0 deletions Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# ---------- Base Stage ----------
FROM ubuntu:22.04-slim AS base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y curl sudo && \
useradd -ms /bin/bash ubuntu && \
usermod -aG sudo ubuntu && \
chown -R ubuntu:ubuntu /home/ubuntu && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ENV HOME=/home/ubuntu
WORKDIR $HOME

# ---------- Standard Environment ----------
FROM base AS standard
USER ubuntu
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \
. "$HOME/.nvm/nvm.sh" && nvm install --lts && npm install -g @haxtheweb/create
CMD ["/bin/bash"]

# ---------- Dev Environment ----------
FROM base AS dev
USER ubuntu
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \
. "$HOME/.nvm/nvm.sh" && nvm install --lts && npm install -g @haxtheweb/create yarn && \
yarn global add symlink-dir @web/test-runner @web/test-runner-commands \
@web/test-runner-puppeteer @web/test-runner-playwright lerna web-component-analyzer && \
npm completion >> ~/.bashrc
CMD ["/bin/bash"]
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# containers
containers in hax land

Containerization of HAXTheWeb dev environments and deployments — containers in hax land

## Project Overview

This repository provides Docker Compose configurations for both a simple hosting environment and a full-featured development environment for HAXTheWeb.

## Prerequisites

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

## Usage

### Simple Host

To run a single, unmanaged site:

```sh
docker compose up -d simplehost
```

- Access your site at [http://localhost:8000](http://localhost:8000)
- Data is persisted in the `simplehost_data` volume.

### Developer Environment

To start the full-featured dev environment:

```sh
docker compose up -d devenv
```

- Access your dev environment at [http://localhost:8001](http://localhost:8001)
- Data is persisted in the `devenv_data` volume.

### Stopping and Removing Containers

```sh
docker compose down
```

## Services

- **simplehost**: Minimal environment for hosting a single site.
- **devenv**: Full dev environment with extra tools and utilities.

## Example Commands

- Build images: `docker compose build`
- View running containers: `docker compose ps`
- View logs: `docker compose logs <service>`
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
# Simple host: for running a single, unmanaged site
simplehost:
build:
context: .
dockerfile: ./Dockerfiles/Dockerfile
target: standard
ports:
- "8000:3000"
tty: true
container_name: simplehost
volumes:
- simplehost_data:/data

# Dev environment: for full-featured development
devenv:
build:
context: .
dockerfile: ./Dockerfiles/Dockerfile
target: dev
ports:
- "8001:3000"
tty: true
container_name: devenv
volumes:
- devenv_data:/data
# Named volumes for persistent data
volumes:
simplehost_data:
devenv_data: