Skip to content

Commit

Permalink
chore: add alpine/debian dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 24, 2024
1 parent 1d35c82 commit ecce3e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG NODE_VERSION=current
FROM node:${NODE_VERSION}-alpine

RUN apk add bash curl git file libc6-compat gcompat jq
# libc6-compat gcompat required for @pact-foundation/pact-cli ruby runtime
# all other dependencies just used for @pact-foundation/pact testing
# so you don't need to use those in your own projects

ENTRYPOINT [ "bash", "-c", "scripts/ci/build-and-test.sh" ]
8 changes: 8 additions & 0 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG NODE_VERSION=latest
FROM node:${NODE_VERSION}-slim

RUN apt-get -y update && apt-get -y install curl git jq
# dependencies just used for @pact-foundation/pact testing
# so you don't need to use those in your own projects

ENTRYPOINT [ "bash", "-c", "scripts/ci/build-and-test.sh" ]
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
"predist": "npm run clean && npm run format:check && npm run lint",
"release": "commit-and-tag-version",
"test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha -t 120000",
"pretest": "bash scripts/install-plugins.sh"
"pretest": "bash scripts/install-plugins.sh",
"docker:alpine:build": "docker build --build-arg NODE_VERSION=${NODE_VERSION:-current} -f Dockerfile.alpine -t pact-js:alpine .",
"docker:debian:build": "docker build --build-arg NODE_VERSION=${NODE_VERSION:-current} -f Dockerfile.debian -t pact-js:debian .",
"docker:alpine:run": "docker run -e LOG_LEVEL=${LOG_LEVEL:-info} -e GIT_REF=${GIT_REF:-test} -e GITHUB_ACTIONS=${GITHUB_ACTIONS:-false} -e SKIP_EXAMPLES=${SKIP_EXAMPLES:-''} -w /home -v $(pwd):/home --rm pact-js:alpine",
"docker:debian:run": "docker run -e LOG_LEVEL=${LOG_LEVEL:-info} -e GIT_REF=${GIT_REF:-test} -e GITHUB_ACTIONS=${GITHUB_ACTIONS:-false} -e SKIP_EXAMPLES=${SKIP_EXAMPLES:-''} -w /home -v $(pwd):/home --rm pact-js:debian",
"docker:alpine:attach": "docker run -w /home -v $(pwd):/home --entrypoint /bin/bash --rm -it pact-js:alpine",
"docker:debian:attach": "docker run -w /home -v $(pwd):/home --entrypoint /bin/bash --rm -it pact-js:debian"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit ecce3e7

Please sign in to comment.