Skip to content

Commit

Permalink
Add docker and run-docker make targets.
Browse files Browse the repository at this point in the history
This enables testing the website locally as follows:

1. Run `make docker`
2. Run `make run-docker`
3. Navigate to http://localhost:5002
  • Loading branch information
robertknight committed Dec 2, 2024
1 parent 0aa1e4f commit 5168a37
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,31 @@ default: help
.PHONY: help
help:
@echo "make help Show this help message"
@echo "make dev Run the pattern library app in a development server"
@echo "make build Build the package"
@echo "make lint Run the code linter(s) and print any warnings"
@echo "make checkformatting Check code formatting"
@echo "make clean Delete development artefacts (cached files etc.)"
@echo "make dev Run the pattern library app in a development server"
@echo "make docker Build Docker image for the website"
@echo "make format Automatically format code"
@echo "make test Run the unit tests once"
@echo "make lint Run the code linter(s) and print any warnings"
@echo "make run-docker Run a Docker container using the image created by \`make docker\`"
@echo "make sure Make sure that the formatter, linter, tests, etc all pass"
@echo "make clean Delete development artefacts (cached files, "
@echo " dependencies, etc)"
@echo "make test Run the unit tests once"

.PHONY: dev
dev: node_modules/.uptodate
node_modules/.bin/gulp watch

.PHONY: docker
docker:
@git archive --format=tar.gz HEAD | docker build -t hypothesis/frontend-shared:latest -

# Run Docker container. Publish to port 5002 on the host to avoid a conflict
# with other Hypothesis projects.
.PHONY: run-docker
run-docker:
@docker run --rm -p 5002:5001 --name hypothesis-frontend-shared hypothesis/frontend-shared:latest

.PHONY: test
test: node_modules/.uptodate
ifdef ARGS
Expand Down

0 comments on commit 5168a37

Please sign in to comment.