diff --git a/Dockerfile b/Dockerfile index fe381303..a7af9f5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ -FROM nikolaik/python-nodejs:python3.9-nodejs14 as build +FROM debian:buster-slim as builder LABEL maintainer="ux@blockstack.com" COPY . . +RUN apt-get update -y && apt-get install -y build-essential python3 nodejs zip curl \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list' \ + && apt-get update -y && apt-get install -y yarn \ + && ./build-ext.sh -# Build browser extensions -RUN apt-get update && \ - apt-get install -y zip make && \ - ./build-ext.sh FROM alpine:latest -COPY --from=build extension.zip . +COPY --from=builder /extension.zip . # Wait for extension.zip to be copied into local -CMD sleep 60 +CMD sleep 30 diff --git a/build-ext.sh b/build-ext.sh index 1e5d108e..eff07e3b 100755 --- a/build-ext.sh +++ b/build-ext.sh @@ -1,11 +1,15 @@ +#!/bin/sh echo "🛠 Installing dependencies." yarn echo "🛠 Building internal packages." yarn lerna run build --scope @stacks/connect-ui echo "🛠 Compiling extension." -yarn lerna run prod:ext +cd packages/app && yarn lerna run prod:ext echo "🛠 Packaging Browser Extension" -cd packages/app/dist -zip -r ../../../extension.zip * +cd dist +TS=$(date +%Y)$(date +%m)010000 +find -print | while read file; do + touch -t $TS "$file" +done +zip -Xro /extension.zip * echo "✅ Extension packaged as extension.zip" -