-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1301 from compdemocracy/heroku-docker-deploy
Heroku docker deploy
- Loading branch information
Showing
29 changed files
with
37,035 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,90 @@ | ||
FROM alpine:latest | ||
ARG TAG=dev | ||
|
||
ENV BUILD_DEPS="bash build-base libpng-dev zlib-dev autoconf automake libtool nasm curl" \ | ||
RUN_DEPS="openssh-client openjdk8-jre" | ||
# polis-client-admin | ||
# Gulp v3 stops us from upgrading beyond Node v11 | ||
FROM docker.io/node:11.15.0-alpine | ||
|
||
WORKDIR /build | ||
COPY . . | ||
WORKDIR /client-admin/app | ||
|
||
# for build scripting | ||
RUN \ | ||
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install) | ||
RUN apk add git --no-cache | ||
|
||
COPY client-admin/package*.json ./ | ||
RUN npm install | ||
|
||
COPY client-admin/polis.config.template.js polis.config.js | ||
# If polis.config.js exists on host, will override template here. | ||
COPY client-admin/. . | ||
|
||
ARG GIT_HASH | ||
RUN npm run deploy:prod | ||
|
||
|
||
# polis-client-participation | ||
# # Gulp v3 stops us from upgrading beyond Node v11 | ||
FROM docker.io/node:11.15.0-alpine | ||
|
||
WORKDIR /client-participation/app | ||
|
||
RUN apk add --no-cache --virtual .build \ | ||
g++ git make python | ||
|
||
# Allow global npm installs in Docker | ||
RUN npm config set unsafe-perm true | ||
|
||
# Upgrade npm v6.7.0 -> v6.9.2 to alias multiple pkg versions. | ||
# See: https://stackoverflow.com/a/56134858/504018 | ||
RUN npm install -g [email protected] | ||
|
||
COPY client-participation/package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
RUN apk del .build | ||
|
||
COPY client-participation/polis.config.template.js polis.config.js | ||
# If polis.config.js exists on host, will override template here. | ||
COPY client-participation/. . | ||
|
||
ARG GIT_HASH | ||
ARG BABEL_ENV=production | ||
|
||
RUN npm run deploy:prod | ||
|
||
|
||
# polis-client-report | ||
# Gulp v3 stops us from upgrading beyond Node v11 | ||
FROM docker.io/node:11.15.0-alpine | ||
|
||
WORKDIR /client-report/app | ||
|
||
RUN apk add git --no-cache | ||
|
||
COPY client-report/package*.json ./ | ||
RUN npm ci | ||
|
||
COPY client-report/polis.config.template.js polis.config.js | ||
# If polis.config.js exists on host, will override template here. | ||
COPY client-report/. . | ||
|
||
ARG GIT_HASH | ||
RUN npm run deploy:prod | ||
|
||
|
||
#FROM docker.io/node:16.9.0-alpine | ||
FROM docker.io/babashka/babashka | ||
|
||
RUN apt-get update && apt-get -y install openjdk-16-jre | ||
|
||
|
||
RUN mkdir /app/ | ||
|
||
WORKDIR /app/ | ||
|
||
COPY ./bin/ ./bin/ | ||
|
||
COPY --from=0 /client-admin/app/dist/ /app/client-admin/dist | ||
COPY --from=1 /client-participation/app/build/ /app/client-participation/dist | ||
COPY --from=2 /client-report/app/build/ /app/client-report/dist | ||
|
||
CMD ./bin/deploy-static-assets.clj --bucket $STATIC_ASSET_DEPLOY_BUCKET | ||
|
||
#apk del $BUILD_DEPS && \ | ||
#rm -rf /tmp/* /var/cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.