forked from open-horizon/exchange-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-exec
37 lines (31 loc) · 1.53 KB
/
Dockerfile-exec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ARG JETTY_BASE_VERSION
FROM jetty:$JETTY_BASE_VERSION
#FROM jetty:alpine
MAINTAINER bruce potter <[email protected]>
ARG SCALA_VERSION
ARG SCALA_VERSION_SHORT
ARG EXCHANGE_API_WAR_VERSION
# The jetty base image sets env vars: JETTY_HOME, JETTY_VERSION, JETTY_BASE
# this is now done in start_exchange.sh
# Configure https in jetty. The keystore will mounted from the host into this container.
#RUN java -jar "$JETTY_HOME/start.jar" --create-startd --add-to-start=https,ssl
# Install tools we want available
USER root
RUN apt-get update && apt-get install -y vim procps
#RUN apk update && apk add curl vim
# install scala
RUN curl -s http://downloads.lightbend.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar -zx -C /usr/local/share
RUN ln -s `ls -1dr /usr/local/share/scala-2* | head -1` /usr/local/share/scala
USER jetty
ENV PATH="/usr/local/share/scala/bin:$PATH"
# Copy default auth config and policy. The base jetty docker image sets JETTY_BASE to /var/lib/jetty and cd's to that
RUN mkdir exchange_config
ADD ./src/main/resources/jaas.config $JETTY_BASE/exchange_config
ADD ./src/main/resources/auth.policy $JETTY_BASE/exchange_config
# copy exchange war file to jetty-base and start it. This listens on port 8080
ADD ./target/scala-$SCALA_VERSION_SHORT/exchange-api_$SCALA_VERSION_SHORT-$EXCHANGE_API_WAR_VERSION.war $JETTY_BASE/webapps/ROOT.war
# copy start script that does some rudimentary option handling
ADD ./start_exchange.sh $JETTY_BASE
EXPOSE 8080
# the jetty container already sets the working dir to $JETTY_BASE
CMD ./start_exchange.sh