Skip to content

Commit

Permalink
dockerfile stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jkupcho committed Oct 10, 2018
1 parent b33cc7e commit 5b1c214
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Building Ratpack Docker Image
`./gradlew ratpack:buildImage`
20 changes: 20 additions & 0 deletions ratpack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "io.ratpack:ratpack-gradle:1.5.4"
classpath 'com.bmuschko:gradle-docker-plugin:3.6.2'
}
}

apply plugin: "io.ratpack.ratpack-java"
apply plugin: "idea"
apply plugin: "com.bmuschko.docker-remote-api"


repositories {
jcenter()
Expand All @@ -20,4 +26,18 @@ dependencies {
compile project(":lopoo-core")
}

distZip {
// You only need to set this if you have specified an archive version. This removes the version number
// from the final distribution package which makes it easier to script in your Dockerfile.
archiveName = 'ratpack-docker.zip'
}

import com.bmuschko.gradle.docker.tasks.image.*

task buildImage(type: DockerBuildImage) {
inputDir = new File("${projectDir}")
dockerFile = new File("${projectDir}/src/docker/Dockerfile")
tag = 'async-talk/ratpack:latest'
}

mainClassName = "com.gmjm.async.ratpack.Main"
6 changes: 6 additions & 0 deletions ratpack/src/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM openjdk:8-jre-alpine
EXPOSE 5050
COPY build/distributions/ratpack-docker.zip /opt/ratpack-docker/
RUN unzip /opt/ratpack-docker/ratpack-docker.zip -d /opt/ratpack-docker
WORKDIR /opt/ratpack-docker/ratpack-docker
CMD ["./bin/ratpack", "-fg"]

0 comments on commit 5b1c214

Please sign in to comment.