Skip to content

Commit

Permalink
FDN-1807: Update Dockerfile to include Dependence day Dockerfile Cont…
Browse files Browse the repository at this point in the history
…ents (#86)

* Update Dockerfile to include Dependence day Dockerfile Contents
  • Loading branch information
himanshuupadhyay101 authored Oct 22, 2023
1 parent bc7a8b5 commit 63e460a
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions Dockerfile-play-builder-17-jammy
Original file line number Diff line number Diff line change
@@ -1,42 +1,76 @@
FROM eclipse-temurin:17-jdk-jammy AS builder

ENV DEBIAN_FRONTEND=noninteractive

# Versions
ARG GIT_USERNAME
ARG GIT_PASSWORD
ARG SBT_VERSION
ARG SCALA_VERSION=2.13
ARG AMMONITE_VERSION=2.5.11
ARG APIBUILDER_CLI_VERSION=0.1.45
ENV GIT_USERNAME $GIT_USERNAME
ENV GIT_PASSWORD $GIT_PASSWORD
ENV SBT_VERSION $SBT_VERSION



ARG GITHUB_TOKEN
RUN test -n "$GITHUB_TOKEN"

ENV PROJECTS_TO_BUILD "experience catalog label shopify webhook demandware harmonization tax order-messenger bundle metric shopify-markets calculator data-platform"

WORKDIR /root

# Install necessary dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -qy openssh-client curl git ruby bash && \
apt-get install --no-install-recommends -qy build-essential curl golang git ca-certificates unzip openssh-client ruby bash && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create SSH directory and add GitHub to known hosts
RUN mkdir /root/.ssh
RUN chmod 0700 /root/.ssh
RUN ssh-keyscan -H github.com >> ~/.ssh/known_hosts
RUN ssh-keyscan -H github.com >> /root/.ssh/known_hosts

# Set the GOPATH
ENV GOPATH /root/go
ENV GOBIN /root/go/bin
ENV PATH $PATH:$GOBIN


RUN curl -L https://github.com/apicollective/apibuilder-cli/archive/$APIBUILDER_CLI_VERSION.zip -o apibuilder-cli.zip \
&& unzip apibuilder-cli.zip \
&& mv /apibuilder-cli-$APIBUILDER_CLI_VERSION /apibuilder-cli
RUN curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local
RUN ln -s /usr/local/sbt/bin/sbt /usr/local/bin/sbt
RUN chmod 0755 /usr/local/bin/sbt

RUN curl -L -o /amm https://github.com/lihaoyi/Ammonite/releases/download/$AMMONITE_VERSION/${SCALA_VERSION}-$AMMONITE_VERSION
RUN git clone "https://$GITHUB_TOKEN@github.com/flowcommerce/tools.git" && \
cd tools && \
make install
RUN for repo in $PROJECTS_TO_BUILD; do echo $repo; git clone --depth 1 https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/flowcommerce/$repo.git; cd $repo; sbt update; cd -; done


FROM eclipse-temurin:17-jdk-jammy

LABEL maintainer="tech@flow.io"

ARG SBT_VERSION
ENV SBT_VERSION $SBT_VERSION

ENV DEBIAN_FRONTEND=noninteractive

ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_SESSION_TOKEN

WORKDIR /root

RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
RUN apt-get update && \
apt-get install --no-install-recommends -qy bash curl libaom3 libavif13 libc6 libcurl4 libfontconfig1 libfreetype6 libgif7 libjpeg8 liblcms2-2 libpng16-16 libssl3 libtiff5 libwebp7 libwebpdemux2 libxml2 postgresql-client ttf-mscorefonts-installer wkhtmltopdf zlib1g && \
ruby golang git awscli hub openssh-server && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -48,5 +82,27 @@ RUN ln -s /usr/local/sbt/bin/sbt /usr/local/bin/sbt
RUN chmod 0755 /usr/local/bin/sbt
RUN mkdir -p .sbt ivy2

#sbt
COPY --from=builder /root/.sbt/ .sbt/.
COPY --from=builder /root/.cache/ .cache/.

#Ammonite
COPY --from=builder /amm /usr/bin/amm
RUN chmod +x /usr/bin/amm

#Dev tool
COPY --from=builder /root/go/bin/dev /usr/bin/dev

#API Builder Setup

COPY --from=builder /apibuilder-cli /opt/apibuilder-cli
RUN mkdir -p $HOME/.apibuilder && touch $HOME/.apibuilder/config

# Update PATH with apibuilder

ENV PATH "$PATH:/opt/apibuilder-cli/bin:/opt/sbt/bin"

# Install Schema Evolution Manager
RUN gem install schema-evolution-manager

ENTRYPOINT ["/bin/bash", "-c"]

0 comments on commit 63e460a

Please sign in to comment.