Skip to content

Commit

Permalink
Optimize dockerfiles (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbyoconnor authored and singhpratyush committed Jul 12, 2018
1 parent 4a4dea7 commit bfa306b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
26 changes: 10 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
FROM alpine:latest
LABEL MAINTAINER="[email protected]"
FROM openjdk:8-alpine
LABEL maintainer="Ansgar Schmidt <[email protected]>"
# Create Volume for persistence
VOLUME ["/loklak_server/data"]

# start loklak
CMD ["/loklak_server/bin/start.sh", "-Idn"]

# setup locales
ENV LANG=en_US.UTF-8

ENV LANG=en_US.UTF-8
# Expose the web interface ports
EXPOSE 80 443

Expand All @@ -20,23 +25,12 @@ ADD build.gradle /loklak_server/
ADD settings.gradle /loklak_server/
ADD test/queries /loklak_server/test/queries/

# install OpenJDK 8 JDK, Ant, and Bash
RUN apk update && apk add openjdk8 git bash && \
RUN apk update && apk add --no-cache git bash && \
# compile loklak
cd /loklak_server && ./gradlew build -x checkstyleMain -x checkstyleTest -x jacocoTestReport && \
# change config file
sed -i 's/^\(port.http=\).*/\180/;s/^\(port.https=\).*/\1443/;s/^\(upgradeInterval=\).*/\186400000000/' \
conf/config.properties && \
# remove OpenJDK 8 JDK and Ant
apk del openjdk8 git && \
# install OpenJDK 8 JRE without GUI support
apk add openjdk8-jre-base
conf/config.properties

# set current working directory to loklak_server
WORKDIR /loklak_server

# Create Volume for persistence
VOLUME ["/loklak_server/data"]

# start loklak
CMD ["/loklak_server/bin/start.sh", "-Idn"]
4 changes: 2 additions & 2 deletions kubernetes/images/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM alpine:latest
FROM openjdk:8-alpine

# Env Vars
ENV LANG=en_US.UTF-8
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

WORKDIR /loklak_server

RUN apk update && apk add openjdk8 git bash && \
RUN apk update && apk add --no-cache git bash && \
git clone https://github.com/loklak/loklak_server.git /loklak_server && \
git checkout origin/master && \
./gradlew build -x test -x checkstyleTest -x checkstyleMain -x jacocoTestReport && \
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/images/staging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM alpine:latest
FROM openjdk:8-alpine

# Env Vars
ENV LANG=en_US.UTF-8
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

WORKDIR /loklak_server

RUN apk update && apk add openjdk8 git bash && \
RUN apk update && apk add --no-cache git bash && \
git clone https://github.com/loklak/loklak_server.git /loklak_server && \
git checkout development && \
./gradlew build -x test -x checkstyleTest -x checkstyleMain -x jacocoTestReport && \
Expand Down

0 comments on commit bfa306b

Please sign in to comment.