SNRK-100: Dockerfile as application
This commit is contained in:
parent
7c5e2b7dbb
commit
652b865b89
19
Dockerfile
19
Dockerfile
@ -1,8 +1,23 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
WORKDIR Snark
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y curl zip unzip
|
||||
|
||||
ARG JAVA_VERSION="17.0.7-zulu"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./snark-main/ci ./snark-main/ci
|
||||
|
||||
RUN ./snark-main/ci/install_sdk.sh
|
||||
RUN ./snark-main/ci/install_java.sh "$JAVA_VERSION"
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN ./requirments.sh
|
||||
RUN ./gradlew build test
|
||||
|
||||
RUN ./gradlew clean build
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ./gradlew :snark-main:run_server
|
@ -1,4 +1,4 @@
|
||||
set -e
|
||||
#!/bin/bash
|
||||
|
||||
apt-get update
|
||||
apt-get install -y sudo
|
||||
|
@ -19,3 +19,8 @@ dependencies {
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.register<JavaExec>("run_server") {
|
||||
classpath = sourceSets.main.get().runtimeClasspath
|
||||
main = "space.kscience.snark.main.MainKt"
|
||||
}
|
||||
|
6
snark-main/ci/install_java.sh
Executable file
6
snark-main/ci/install_java.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
JAVA_VERSION="$1"
|
||||
|
||||
source ~/.sdkman/bin/sdkman-init.sh
|
||||
sdk install java "$JAVA_VERSION"
|
3
snark-main/ci/install_sdk.sh
Executable file
3
snark-main/ci/install_sdk.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -s "https://get.sdkman.io" | bash
|
Loading…
Reference in New Issue
Block a user