Skip to content

Instantly share code, notes, and snippets.

@rzachariah
Created October 10, 2016 19:40
Show Gist options
  • Save rzachariah/77eb927f650347ef06d0009dc220cd4a to your computer and use it in GitHub Desktop.
Save rzachariah/77eb927f650347ef06d0009dc220cd4a to your computer and use it in GitHub Desktop.
sbt in a Dockerfile
FROM openjdk:8
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get -qq update
# Install node
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y build-essential
# debian installs `node` as `nodejs`
RUN update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
RUN node -v
RUN npm -v
# Install sbt
ENV SBT_VERSION 0.13.12
RUN \
curl -L -o sbt-$SBT_VERSION.deb http://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
sbt sbtVersion
# Install graphql-toolbox in container
WORKDIR /app
ADD package.json /app/
RUN npm install
COPY . /app
EXPOSE 9000
# Start web server
CMD [ "sbt", "run" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment