Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker publish preparation #630

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions docker/styx-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
ARG TAG=11-jdk
FROM openjdk:${TAG}

RUN addgroup styx && useradd -d /home/styx -g styx -s /bin/bash styx

# Remove overriding ulimits
RUN rm -f /etc/security/limits.d/*

ARG STYX_VERSION=""
ARG STYX_IMAGE=https://github.com/HotelsDotCom/styx/releases/download/${STYX_VERSION}/${STYX_VERSION}-linux-x86_64.zip

ENV APP_HOME=/styx

ENV STYX_CONFIG=/styx/default-config/default.yml
ENV STYX_LOG_CONFIG=/styx/styx/conf/logback.xml
ENV STYX_LOG_CONFIG=/styx/conf/logback.xml
ENV STYX_ENV_FILE=/styx/default-config/styx-env.sh
ENV STYX_LOG_OUTPUT=/styx/logs/

ADD ${STYX_IMAGE} /styx.zip
RUN unzip /styx.zip \
&& rm /styx.zip

WORKDIR ${APP_HOME}

ADD ${STYX_IMAGE} ${APP_HOME}/styx.zip
ADD default-docker.yml /styx/default-config/default.yml
ADD styx-env.sh /styx/default-config/styx-env.sh
ADD origins.yml /styx/default-config/origins.yml

RUN unzip styx.zip \
&& rm styx.zip
RUN mkdir -p ${STYX_LOG_OUTPUT}
RUN chown styx:styx ${STYX_LOG_OUTPUT}

EXPOSE 8080 8443 9000

USER styx

CMD ["/styx/default-config/default.yml"]

ENTRYPOINT ["styx/bin/startup"]
ENTRYPOINT ["bin/startup"]
4 changes: 2 additions & 2 deletions docker/styx-image/styx-env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright (C) 2013-2019 Expedia Inc.
# Copyright (C) 2013-2020 Expedia Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
JVM_DIRECT_MEMORY="${JVM_DIRECT_MEMORY:=-XX:MaxDirectMemorySize=512m}"
JVM_HEAP_OPTS="${JVM_HEAP_OPTS:=-XX:+AlwaysPreTouch}"

JVM_GC_LOG="${JVM_GC_LOG:=-XX:+PrintGCDetails -Xloggc:/styx/logs/gc.log.$(/bin/date +%Y-%m-%d-%H%M%S)}"
JVM_GC_LOG="${JVM_GC_LOG:=-XX:+PrintGCDetails -Xloggc:${APP_HOME}/logs/gc.log.$(/bin/date +%Y-%m-%d-%H%M%S)}"
JVM_HEAP_DUMP="${JVM_HEAP_DUMP:=-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/tmp}"

# Set java VM type
Expand Down