Skip to content
Permalink
Browse files

Dockerize

  • Loading branch information...
napstr committed Nov 12, 2017
1 parent d86a76e commit f8f842bbed671d09e6de0c13dcfeffe79ee691ed
Showing with 62 additions and 1 deletion.
  1. +5 −0 .dockerignore
  2. +15 −0 .travis.yml
  3. +12 −0 Dockerfile
  4. +5 −1 build.gradle
  5. +25 −0 docker-compose.yml
@@ -0,0 +1,5 @@
**
#ignore everything except the following files, they are used in the Dockerfile to build the image
!Dockerfile
!wolfia.jar
!build/libs/wolfia.jar
@@ -1,7 +1,15 @@
sudo: required

services:
- docker

env:
global:
- BUILD_NUMBER: "$TRAVIS_BUILD_NUMBER"
- BINTRAY_USER: napster
- secure: "TibOvGlMn0dBK97rMpvHtk17iEQszuZJkL6rqc8FoKOmMb36CFdHK7lGUCGHEoYwCl2Cs4OSICWyLhmYwfP623vYLrXfd5fdBbHWaSO1RtQkGK9+roomb80tkYleKBUArWrteYk+uevWA7HxWoQXmoVKD/DvppF6tZsJq2sv8BFQZSE2XDtiQ5QvotD0j4ypSwatZFT73AAGJlxbT3fBrx5gNw6bLJd8ZEdjRTEL+bHPAh+iqURVg3181RcEJQA3N+uAn2dkdByn4TENBLvsr4HuQmkeG0W7yTWIhZZS+t2sbp4i2PrGmEVaGeqc4DqqVSAR522NLOzwfpxXJcRr9xmfQXnt2qPyfK7cZQET/QuRvUIBw1IQo42Bae2Kk0Xhvm45FSOmgYY1YyFNFhdaK/pCbHd5jmp6djTeajeiEaH7Th6LBcDfTrNK8dmL2THvSxsodH2FRwlks+9t3KY7ZwwxXbpwbPb95qYpR8bDqlf9aIE5awNf6LXTi4l97mMNeLoN9e9yXtmDUdjPGkqZqi1nTdFfJH1Qx3RNwufFRVoIfJ7wNQG1W14hTaw6JGXCbEyJkQ5cHFzSW0T+7KH53IicnXbLDneenViDuw21vBwgT+53aHENhgwR5ZpdbhIyUVdGPvxF8udmp2NCmW3ePJrVKwWHKjj+F9I+5g4F49I="
- DOCKER_USERNAME: napstr
- secure: "RFvBcJzgPu2wvPuhxAgYNowqD4UsbgEzG06/DzWcDeRZEemnexCJr46ppL1Q7HDdYE4ftxh5H4g4O92SfNVdo0NZZGfm0E1/aHDurA40+OVML80akkwbxevU+FgXe8qofvhaF+byHgxj5m6VUAuANTV/oA3boyDbFazth8QA2+oOHLKmoTkJG0w/bBqad5q8U99rS+gwJE6tXce02X7Z4Bz7YNbl/luEJoWDVbbCv8jPoHB/RJ+OEQx3/WTKgiSjIpt70eYsjnzgW5ZJ0eWteWwwTACUX254tIUty81rkRvmPUtOEYDakVx4MeqPpsDtFmu/dffJ4ofQXkEX2cW36Y8VOPYP1dBO++iYaPZtInw2xIptIi9xCEJO1Wh1VmEK8Fb2xjFsaFzPTCVz+M0+MZxn7JuGcK1ZHN960zRkkVXP68b+YcGVUgVTJV7DyRQbhyrZY/bD/osJ695KeFx7b9SIus/FH0D2ONqp9Z5gvvA0u+Gt7ChMLY6TJTXVRThzpGOuU203cTZGysBHPfoFKMW4yR2bCFrSHG4ADw8eLFwFiYHwc0EERm8/8Cif3xvE2dTxNAONMbK0zXPGAy42D3dOt7eXT0EDQLQDQjkwGgnlv7lV8FhpEne78V8BdVr+UIUeK0IaNU0DDN/aLW52gLMlrBCYvAX7u4u7A937GYg="

language: java

@@ -10,3 +18,10 @@ jdk:

script:
- ./gradlew shadowJar bintrayUpload --info
- TAG_NAME=$(echo ${TRAVIS_BRANCH} | sed -e 's/\//_/g')
- docker build --tag "napstr/wolfia:$TAG_NAME" .

after_success:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push napstr/wolfia:$TAG_NAME
- docker logout
@@ -0,0 +1,12 @@
FROM openjdk:9-jre-slim

ENV ENV docker

RUN mkdir /opt/wolfia

COPY build/libs/wolfia.jar /opt/wolfia/wolfia.jar

EXPOSE 4567

WORKDIR /opt/wolfia
ENTRYPOINT ["java", "-jar", "-Xmx512m", "wolfia.jar"]
@@ -9,7 +9,7 @@ plugins {
}

group = 'space.npstr'
version = '0.9.2-' + (System.getenv('TRAVIS') ? System.getenv('TRAVIS_BUILD_NUMBER') : 'SNAPSHOT')
version = '0.10.0-' + (System.getenv('CI') ? System.getenv('TRAVIS_BUILD_NUMBER') : 'SNAPSHOT')

mainClassName = "space.npstr.wolfia.Wolfia"

@@ -78,6 +78,10 @@ versionFile {
prefix = 'GIT_'
}

shadowJar {
archiveName = "wolfia.jar"
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
@@ -0,0 +1,25 @@
version: '3'
services:

bot:
#build: .
image: napstr/wolfia:master
restart: on-failure:3
network_mode: "host" #to reach the local database
ports:
- 4567:4567
volumes:
- ./sneaky.yaml:/opt/wolfia/sneaky.yaml
- ./logs:/opt/wolfia/logs
- ./logs/gc:/opt/wolfia/logs/gc
entrypoint:
- java
- -jar
- -Xmx512m
- -XX:+HeapDumpOnOutOfMemoryError
- -XX:HeapDumpPath=emergencydump.hprof
- -Xlog:gc*:logs/gc/gc-%t.log
- -XX:+UseG1GC
- -XX:+ParallelRefProcEnabled
- -XX:+UseStringDeduplication
- wolfia.jar

0 comments on commit f8f842b

Please sign in to comment.
You can’t perform that action at this time.