diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 0000000..62df2da --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +build.sh \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..998b1b3 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM node:10-alpine + +ARG VERSION=latest + +# Install deps +WORKDIR /polyfill + +# Use node-gyp / python and install +RUN apk add --no-cache --virtual .gyp \ + python \ + make \ + git \ + g++ \ + && npm install @wessberg/polyfiller@${VERSION} --no-optional --production \ + && apk del .gyp git python make g++ + +# Add source files +COPY ./ . + +CMD ["npm", "start"] diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 0000000..1520ee6 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +SCOPE=wessberg +NAME=polyfiller + +# Build latest +TAG=latest +docker build -t $NAME:$TAG -f ./Dockerfile . +docker tag $NAME:$TAG $SCOPE/$NAME +docker push $SCOPE/$NAME:$TAG + +# Build latest specific version +VERSION=$(npm view @wessberg/polyfiller version) +TAG=$VERSION +docker build -t $NAME:$TAG --build-arg VERSION=$VERSION -f ./Dockerfile . +docker tag $NAME:$TAG $SCOPE/$NAME:$TAG +docker push $SCOPE/$NAME:$TAG \ No newline at end of file diff --git a/docker/package.json b/docker/package.json new file mode 100644 index 0000000..79ca608 --- /dev/null +++ b/docker/package.json @@ -0,0 +1,11 @@ +{ + "name": "polyfill", + "private": true, + "main": "start.js", + "scripts": { + "start": "node start.js" + }, + "engines": { + "node": ">=10.1.0" + } +} diff --git a/docker/start.js b/docker/start.js new file mode 100644 index 0000000..e021eb3 --- /dev/null +++ b/docker/start.js @@ -0,0 +1 @@ +require("@wessberg/polyfiller");