-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45ca090
commit a9a5d54
Showing
2 changed files
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
app/node_modules | ||
app/.next |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
FROM alpine | ||
|
||
ENV SUMMARY="A tools image for the cas-ciip-portal project" \ | ||
DESCRIPTION="This image contains the development tool needed to build the ciip portal repository. The tools are installed via asdf (when available)" | ||
|
||
LABEL summary="$SUMMARY" \ | ||
description="$DESCRIPTION" \ | ||
io.k8s.description="$DESCRIPTION" \ | ||
io.k8s.display-name="CAS CIIP Portal tools" \ | ||
io.openshift.tags="s2i,cas,ciip,builder-image" \ | ||
name="cas-ciip-portal-tools" \ | ||
version="1" \ | ||
maintainer="Matthieu Foucault <matthieu@button.is>" | ||
|
||
RUN apk --no-cache add bash git build-base automake autoconf readline-dev \ | ||
ncurses-dev openssl-dev yaml-dev libxslt-dev libffi-dev libtool \ | ||
unixodbc-dev openssh-client curl gnupg coreutils | ||
|
||
RUN adduser --home /home/ciip --system ciip -G root | ||
USER ciip | ||
WORKDIR /home/ciip | ||
COPY app/ /home/ciip/ | ||
|
||
RUN git clone https://github.com/asdf-vm/asdf.git ~/asdf --branch v0.7.4 | ||
RUN cd ~/asdf && git checkout v0.7.4 | ||
ENV BASH_ENV="/home/asdf/asdf.sh" | ||
# Because asdf is loaded via BASH_ENV, all commands using adsf need to be executed using /usr/bin/env bash -c | ||
SHELL ["/usr/bin/env", "bash", "-c"] | ||
|
||
COPY .tool-versions /home/ciip/.tool-versions | ||
# The app only needs yarn and node | ||
RUN sed -i -nr '/node|yarn/p' .tool-versions | ||
RUN cat ~/.tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add | ||
RUN asdf plugin-update --all | ||
# The nodejs release team keyring is needed to install the asdf node plugin | ||
RUN ~/.asdf/plugins/nodejs/bin/import-release-team-keyring | ||
|
||
RUN asdf install | ||
RUN asdf reshim | ||
|
||
RUN yarn install --frozen-lockfile --production=false && \ | ||
yarn build:relay && \ | ||
yarn build:next && \ | ||
yarn build:storybook && \ | ||
yarn install --frozen-lockfile --production=true && \ | ||
yarn cache clean | ||
|
||
|
||
# Make everything in the tools home group-writable, to accomodate anyuid (in OpenShift) | ||
USER root | ||
COPY .bin/fix-permissions /usr/bin/fix-permissions | ||
RUN fix-permissions /home/tools | ||
|
||
ENTRYPOINT ["bash"] |