From 2bd7fabb50543f01b6924232dce5f7d40b7acd40 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Sun, 7 Jan 2018 12:28:54 -0800 Subject: [PATCH 1/9] Start on Docker Integration SpongeAuth fails to connect to the DB currently but we're getting there. Signed-off-by: Jadon Fowler --- .dockerignore | 3 +++ Dockerfile | 26 ++++++++++++++++++++++++++ conf/application.conf.template | 4 ++-- docker-compose.yml | 19 +++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..45117aa99 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +# This is created in the Dockerfile +conf/application.conf + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ae0e6eaa5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:latest + +MAINTAINER Jadon Fowler + +RUN apt-get update +RUN apt-get install -y default-jdk + +# Install Activator +RUN apt-get install -y unzip curl +RUN curl -O http://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip +RUN unzip typesafe-activator-1.3.6.zip -d / && rm typesafe-activator-1.3.6.zip && chmod a+x /activator-dist-1.3.6/activator +ENV PATH $PATH:/activator-dist-1.3.6 + +# Copy Ore +RUN mkdir -p /home/play/ore/ +WORKDIR /home/play/ore/ +ADD . /home/play/ore/ + +# Ore runs on port 9000 +# 8888 is the Activator UI +EXPOSE 9000 + +RUN cp conf/application.conf.template conf/application.conf + +CMD ["activator", "run"] + diff --git a/conf/application.conf.template b/conf/application.conf.template index f9431d864..cd2af841d 100755 --- a/conf/application.conf.template +++ b/conf/application.conf.template @@ -155,9 +155,9 @@ slick.dbs.default { driver = "org.postgresql.Driver" url = "jdbc:postgresql://localhost/ore" url = ${?JDBC_DATABASE_URL} - user = "root" + user = "spongeauth" user = ${?JDBC_DATABASE_USERNAME} - password = "" + password = "spongeauth" password = ${?JDBC_DATABASE_PASSWORD} } } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..dcc8744e5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: "2" + +services: + app: + build: . + ports: + - "9000:9000" + links: + - "db" + - "spongeauth" + db: + image: postgres:9.6 + environment: + POSTGRES_USER: spongeauth + POSTGRES_PASSWORD: spongeauth + POSTGRES_DB: spongeauth + spongeauth: + image: spongepowered/spongeauth + From a0c3ab0042668d773332e9baa52f781d0504ce1c Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Mon, 5 Mar 2018 13:16:57 -0800 Subject: [PATCH 2/9] Reset Ore password & Change Docker Image Signed-off-by: Jadon Fowler --- Dockerfile | 8 +++----- conf/application.conf.template | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae0e6eaa5..25bdf5aaf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM ubuntu:latest +FROM openjdk:8-jdk-alpine MAINTAINER Jadon Fowler -RUN apt-get update -RUN apt-get install -y default-jdk - # Install Activator -RUN apt-get install -y unzip curl +RUN apk add curl +RUN apk add unzip RUN curl -O http://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip RUN unzip typesafe-activator-1.3.6.zip -d / && rm typesafe-activator-1.3.6.zip && chmod a+x /activator-dist-1.3.6/activator ENV PATH $PATH:/activator-dist-1.3.6 diff --git a/conf/application.conf.template b/conf/application.conf.template index 2ca7109f8..30fdd698e 100755 --- a/conf/application.conf.template +++ b/conf/application.conf.template @@ -163,9 +163,9 @@ slick.dbs.default { driver = "org.postgresql.Driver" url = "jdbc:postgresql://localhost/ore" url = ${?JDBC_DATABASE_URL} - user = "spongeauth" + user = "root" user = ${?JDBC_DATABASE_USERNAME} - password = "spongeauth" + password = "" password = ${?JDBC_DATABASE_PASSWORD} } } @@ -265,4 +265,4 @@ filters { block-all-mixed-content = [] } } -} \ No newline at end of file +} From b2695497ee09c6150e8f65643b6a66e010547301 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Mon, 5 Mar 2018 18:38:00 -0800 Subject: [PATCH 3/9] Temp commit Signed-off-by: Jadon Fowler --- Dockerfile | 7 +++---- conf/application.conf.template | 16 ++++++++-------- docker-compose.yml | 14 +++++++++++--- docker.sh | 12 ++++++++++++ 4 files changed, 34 insertions(+), 15 deletions(-) create mode 100755 docker.sh diff --git a/Dockerfile b/Dockerfile index 25bdf5aaf..63f51af79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM openjdk:8-jdk-alpine MAINTAINER Jadon Fowler # Install Activator -RUN apk add curl -RUN apk add unzip +RUN apk update +RUN apk add curl unzip bash postgresql RUN curl -O http://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip RUN unzip typesafe-activator-1.3.6.zip -d / && rm typesafe-activator-1.3.6.zip && chmod a+x /activator-dist-1.3.6/activator ENV PATH $PATH:/activator-dist-1.3.6 @@ -20,5 +20,4 @@ EXPOSE 9000 RUN cp conf/application.conf.template conf/application.conf -CMD ["activator", "run"] - +CMD ["/home/play/ore/docker.sh"] diff --git a/conf/application.conf.template b/conf/application.conf.template index 30fdd698e..f7d187683 100755 --- a/conf/application.conf.template +++ b/conf/application.conf.template @@ -12,7 +12,7 @@ application { # Add a dot at the start of the url to trust all subdomains trustedUrlHosts = [ ".spongepowered.org" ] - + fakeUser { enabled = false id = -1 @@ -74,14 +74,14 @@ ore { # Used in /admin/seed route. Run "gradle build" in OreTestPlugin before using that route test-plugin = "OreTestPlugin/build/libs/ore-test-plugin-dev-SNAPSHOT.jar" caching = true - + channels { max-name-len = 15 name-regex = "^[a-zA-Z0-9]+$" color-default = 7 name-default = "Release" } - + pages { home.name = "Home" home.message = "Welcome to your new project!" @@ -89,7 +89,7 @@ ore { max-len = 32000 name.max-len = 255 } - + projects { max-name-len = 25 max-pages = 50 @@ -104,7 +104,7 @@ ore { check-interval = 300000 // 1 hour (millis) draft-expire = 86400000 // 1 day (millis) } - + users { stars-per-page = 5 max-tagline-len = 100 @@ -112,7 +112,7 @@ ore { project-page-size = 5 syncRate = 10800000 } - + orgs { enabled = true passwordLength = 60 @@ -165,7 +165,7 @@ slick.dbs.default { url = ${?JDBC_DATABASE_URL} user = "root" user = ${?JDBC_DATABASE_USERNAME} - password = "" + password = "ore" password = ${?JDBC_DATABASE_PASSWORD} } } @@ -176,7 +176,7 @@ discourse { baseUrl = "https://forums.spongepowered.org" embed.retryRate = 60000 embed.categorySlug = ore - + api { enabled = true key = ${?DISCOURSE_API_KEY} diff --git a/docker-compose.yml b/docker-compose.yml index dcc8744e5..6624de920 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,27 @@ version: "2" +#volumes: +# ore-db: + services: app: build: . ports: - "9000:9000" +# depends_on: +# - spongeauth links: - "db" - "spongeauth" db: image: postgres:9.6 + restart: always +# volumes: +# - ore-db:/var/lib/postgresql environment: - POSTGRES_USER: spongeauth - POSTGRES_PASSWORD: spongeauth - POSTGRES_DB: spongeauth + POSTGRES_USER: root + POSTGRES_PASSWORD: ore + POSTGRES_DB: ore spongeauth: image: spongepowered/spongeauth diff --git a/docker.sh b/docker.sh new file mode 100755 index 000000000..f55c1af1a --- /dev/null +++ b/docker.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "Adding SpongeAuth User" +#export PGPASSWORD=ore +until psql -h 'db' -U postgres -c "create role spongeauth with login password 'spongeauth';"; do + echo "Ore is waiting for PostgreSQL to start." >&2 + sleep 1 +done +#groupadd -g "$(stat -c '%g' /home/play/ore/app)" -o spongeauth +#useradd -u "$(stat -c '%u' /home/play/ore/app)" -g spongeauth -o -m spongeauth + +activator run From 94e601c33143dab235fc72338b776a769d626a8a Mon Sep 17 00:00:00 2001 From: kashike Date: Sat, 14 Jul 2018 15:03:28 -0700 Subject: [PATCH 4/9] it works --- .docker/db/Dockerfile | 3 +++ .docker/db/init.sql | 3 +++ docker-compose.yml | 13 +++++++------ docker.sh | 6 ------ 4 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 .docker/db/Dockerfile create mode 100644 .docker/db/init.sql diff --git a/.docker/db/Dockerfile b/.docker/db/Dockerfile new file mode 100644 index 000000000..a93cd9f9d --- /dev/null +++ b/.docker/db/Dockerfile @@ -0,0 +1,3 @@ +FROM postgres:9.6 + +COPY init.sql /docker-entrypoint-initdb.d/ diff --git a/.docker/db/init.sql b/.docker/db/init.sql new file mode 100644 index 000000000..509d42f37 --- /dev/null +++ b/.docker/db/init.sql @@ -0,0 +1,3 @@ + +create database spongeauth; +create role spongeauth with login password 'spongeauth'; diff --git a/docker-compose.yml b/docker-compose.yml index 6624de920..7fae3c171 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,15 +6,14 @@ version: "2" services: app: build: . + depends_on: + - 'db' + - 'spongeauth' ports: - "9000:9000" -# depends_on: -# - spongeauth - links: - - "db" - - "spongeauth" + stdin_open: true db: - image: postgres:9.6 + build: '.docker/db/' restart: always # volumes: # - ore-db:/var/lib/postgresql @@ -24,4 +23,6 @@ services: POSTGRES_DB: ore spongeauth: image: spongepowered/spongeauth + depends_on: + - 'db' diff --git a/docker.sh b/docker.sh index f55c1af1a..7e8d3e015 100755 --- a/docker.sh +++ b/docker.sh @@ -1,11 +1,5 @@ #!/bin/sh -echo "Adding SpongeAuth User" -#export PGPASSWORD=ore -until psql -h 'db' -U postgres -c "create role spongeauth with login password 'spongeauth';"; do - echo "Ore is waiting for PostgreSQL to start." >&2 - sleep 1 -done #groupadd -g "$(stat -c '%g' /home/play/ore/app)" -o spongeauth #useradd -u "$(stat -c '%u' /home/play/ore/app)" -g spongeauth -o -m spongeauth From 024ff5ebf06e54c95f8420f7d3961bb045d467ba Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Mon, 16 Jul 2018 19:45:48 -0700 Subject: [PATCH 5/9] Connect Ore to the Docker DB Signed-off-by: Jadon Fowler --- .docker/db/init.sql | 1 - conf/application.conf.template | 4 ++-- docker-compose.yml | 10 +++------- docker.sh | 6 ++---- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.docker/db/init.sql b/.docker/db/init.sql index 509d42f37..d43b8ccd5 100644 --- a/.docker/db/init.sql +++ b/.docker/db/init.sql @@ -1,3 +1,2 @@ - create database spongeauth; create role spongeauth with login password 'spongeauth'; diff --git a/conf/application.conf.template b/conf/application.conf.template index edfd9ddd8..6f1e3d4f0 100755 --- a/conf/application.conf.template +++ b/conf/application.conf.template @@ -11,7 +11,7 @@ application { uploadsDir = ${?UPLOADS_DIR} # Add a dot at the start of the url to trust all subdomains - trustedUrlHosts = [ ".spongepowered.org" ] + trustedUrlHosts = [ ".spongepowered.org", "spongeauth" ] fakeUser { enabled = false @@ -173,7 +173,7 @@ slick.dbs.default { url = ${?JDBC_DATABASE_URL} user = "root" user = ${?JDBC_DATABASE_USERNAME} - password = "ore" + password = "" password = ${?JDBC_DATABASE_PASSWORD} } } diff --git a/docker-compose.yml b/docker-compose.yml index 7fae3c171..c835e6bd2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,5 @@ version: "2" -#volumes: -# ore-db: - services: app: build: . @@ -15,14 +12,13 @@ services: db: build: '.docker/db/' restart: always -# volumes: -# - ore-db:/var/lib/postgresql environment: POSTGRES_USER: root - POSTGRES_PASSWORD: ore + POSTGRES_PASSWORD: "" POSTGRES_DB: ore spongeauth: image: spongepowered/spongeauth depends_on: - 'db' - + ports: + - "8000:8000" diff --git a/docker.sh b/docker.sh index 7e8d3e015..3adfb62fa 100755 --- a/docker.sh +++ b/docker.sh @@ -1,6 +1,4 @@ #!/bin/sh -#groupadd -g "$(stat -c '%g' /home/play/ore/app)" -o spongeauth -#useradd -u "$(stat -c '%u' /home/play/ore/app)" -g spongeauth -o -m spongeauth - -activator run +# We want to connect to db/ore +env JDBC_DATABASE_URL="jdbc:postgresql://db/ore" SPONGE_AUTH_URL="http://spongeauth:8000" activator run From 62e8d65587e17929edffc55a524581791e091c17 Mon Sep 17 00:00:00 2001 From: RedNesto Date: Tue, 28 Aug 2018 23:41:31 +0200 Subject: [PATCH 6/9] Some work on Docker based on what Phase made on his PR The Ore container may have to be manually configured for some stuff --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 38 +++++++++++++++++++++++--------------- build.sbt | 3 +++ docker-compose.yml | 8 ++++---- 4 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.dockerignore b/.dockerignore index 45117aa99..988ddbf38 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,19 @@ +/* + +!app/ + +!conf/ # This is created in the Dockerfile conf/application.conf +!OreTestPlugin/ + +!project/ +project/target/ +project/project/ + +!public/ + +!scripts/ + +!build.sbt diff --git a/Dockerfile b/Dockerfile index 63f51af79..20671a00a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,31 @@ FROM openjdk:8-jdk-alpine -MAINTAINER Jadon Fowler +LABEL maintainer="Jadon Fowler " -# Install Activator -RUN apk update -RUN apk add curl unzip bash postgresql -RUN curl -O http://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip -RUN unzip typesafe-activator-1.3.6.zip -d / && rm typesafe-activator-1.3.6.zip && chmod a+x /activator-dist-1.3.6/activator -ENV PATH $PATH:/activator-dist-1.3.6 +# Temporary build folder for the 'stage' task +WORKDIR /home/ore/build +ADD . ./ +ADD conf/application.conf.template conf/application.conf -# Copy Ore -RUN mkdir -p /home/play/ore/ -WORKDIR /home/play/ore/ -ADD . /home/play/ore/ +ENV SBT_VERSION=0.13.9 \ + SBT_HOME=/usr/local/sbt \ + JDBC_DATABASE_URL=jdbc:postgresql://db/ore \ + SPONGE_AUTH_URL=http://spongeauth:8000 \ + APPLICATION_SECRET="some_secret" + +ENV PATH=${PATH}:${SBT_HOME}/bin + +RUN apk add --virtual --no-cache curl ca-certificates bash && \ + curl -sL "http://dl.bintray.com/sbt/native-packages/sbt/$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local && \ + sbt stage && \ + apk del curl + +WORKDIR /home/ore/prod/bin/ + +RUN cp -r /home/ore/build/target/universal/stage/* /home/ore/prod/ && \ + rm -rf /home/ore/build/ # Ore runs on port 9000 -# 8888 is the Activator UI EXPOSE 9000 -RUN cp conf/application.conf.template conf/application.conf - -CMD ["/home/play/ore/docker.sh"] +CMD ["./ore"] diff --git a/build.sbt b/build.sbt index d6d2e9d8a..60c4b9f79 100755 --- a/build.sbt +++ b/build.sbt @@ -11,6 +11,9 @@ resolvers ++= Seq( "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/" ) +sources in (Compile, doc) := Seq.empty +publishArtifact in (Compile, packageDoc) := false + libraryDependencies ++= Seq( ehcache , ws , specs2 % Test , guice ) libraryDependencies ++= Seq( "org.spongepowered" % "play-discourse" % "3.0", diff --git a/docker-compose.yml b/docker-compose.yml index c835e6bd2..abb3c7e87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "2" +version: '2' services: app: @@ -7,18 +7,18 @@ services: - 'db' - 'spongeauth' ports: - - "9000:9000" + - '9000:9000' stdin_open: true db: build: '.docker/db/' restart: always environment: POSTGRES_USER: root - POSTGRES_PASSWORD: "" + POSTGRES_PASSWORD: '' POSTGRES_DB: ore spongeauth: image: spongepowered/spongeauth depends_on: - 'db' ports: - - "8000:8000" + - '8000:8000' From c525e5e82ac5b48e9e8c47942dc7971367e70df3 Mon Sep 17 00:00:00 2001 From: RedNesto Date: Tue, 28 Aug 2018 23:41:49 +0200 Subject: [PATCH 7/9] Proper SBT setup for building the image --- Dockerfile | 27 +++++++++++++++++++-------- docker-compose.yml | 5 ++++- docker.sh | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 20671a00a..0d44ab513 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ +# This Dockerfile is designed to be used for production FROM openjdk:8-jdk-alpine LABEL maintainer="Jadon Fowler " # Temporary build folder for the 'stage' task WORKDIR /home/ore/build +# The .dockerignore file on the project root avoids build cache and personal configuration to be included in the image ADD . ./ -ADD conf/application.conf.template conf/application.conf -ENV SBT_VERSION=0.13.9 \ +# TODO use Docker secrets for the app key and passwords (and any other sensible information) +ENV SBT_VERSION=1.2.1 \ SBT_HOME=/usr/local/sbt \ JDBC_DATABASE_URL=jdbc:postgresql://db/ore \ SPONGE_AUTH_URL=http://spongeauth:8000 \ @@ -15,15 +17,24 @@ ENV SBT_VERSION=0.13.9 \ ENV PATH=${PATH}:${SBT_HOME}/bin -RUN apk add --virtual --no-cache curl ca-certificates bash && \ - curl -sL "http://dl.bintray.com/sbt/native-packages/sbt/$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local && \ +# TODO a shell script to extract the SBT version from project/build.properties and set SBT_VERSION to the output value +RUN cp conf/application.conf conf/application.conf && \ + apk add --virtual --no-cache curl ca-certificates bash && \ +# Downloads SBT with the version given above and extracts it + curl -sL "https://piccolo.link/sbt-$SBT_VERSION.tgz" -o "sbt-$SBT_VERSION.tgz" && \ + tar -xvzf "sbt-$SBT_VERSION.tgz" -C /usr/local && \ +# Compiles Ore and makes a production distribution (but not in an archive, unlike 'dist') sbt stage && \ + mkdir -p /home/ore/prod && \ +# Copy the 'stage' task result _content_ into the production directory + cp -r /home/ore/build/target/universal/stage/* /home/ore/prod && \ +# Cleans the temporary build directory, as we don't need it in the final image + rm -rf /home/ore/build && \ +# SBT is no longer needed too + rm -rf $SBT_HOME && \ apk del curl -WORKDIR /home/ore/prod/bin/ - -RUN cp -r /home/ore/build/target/universal/stage/* /home/ore/prod/ && \ - rm -rf /home/ore/build/ +WORKDIR /home/ore/prod/bin # Ore runs on port 9000 EXPOSE 9000 diff --git a/docker-compose.yml b/docker-compose.yml index abb3c7e87..eb58ffece 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,8 @@ -version: '2' +version: '3' services: app: + image: ore:1.6.8 build: . depends_on: - 'db' @@ -12,6 +13,8 @@ services: db: build: '.docker/db/' restart: always + ports: + - '5432:5432' environment: POSTGRES_USER: root POSTGRES_PASSWORD: '' diff --git a/docker.sh b/docker.sh index 3adfb62fa..fe01fb4dd 100755 --- a/docker.sh +++ b/docker.sh @@ -1,4 +1,5 @@ #!/bin/sh +# This is probably not needed anymore # We want to connect to db/ore -env JDBC_DATABASE_URL="jdbc:postgresql://db/ore" SPONGE_AUTH_URL="http://spongeauth:8000" activator run +JDBC_DATABASE_URL="jdbc:postgresql://db/ore" SPONGE_AUTH_URL="http://spongeauth:8000" java -jar From 3ce6f231669a1c16d3ac7457560be1b50ac97112 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Sat, 15 Sep 2018 08:31:21 -0700 Subject: [PATCH 8/9] Fix APK dependencies & ignore Hydra in Docker Signed-off-by: Jadon Fowler --- .dockerignore | 2 ++ Dockerfile | 26 ++++++++++++++++---------- docker.sh | 5 ----- 3 files changed, 18 insertions(+), 15 deletions(-) delete mode 100755 docker.sh diff --git a/.dockerignore b/.dockerignore index 988ddbf38..ffd0a2a7b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,6 +11,8 @@ conf/application.conf !project/ project/target/ project/project/ +# Hydra Scala Compiler +project/hydra.sbt !public/ diff --git a/Dockerfile b/Dockerfile index 0d44ab513..449e47def 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,21 +18,27 @@ ENV SBT_VERSION=1.2.1 \ ENV PATH=${PATH}:${SBT_HOME}/bin # TODO a shell script to extract the SBT version from project/build.properties and set SBT_VERSION to the output value -RUN cp conf/application.conf conf/application.conf && \ - apk add --virtual --no-cache curl ca-certificates bash && \ +RUN cp conf/application.conf.template conf/application.conf +RUN apk update +RUN apk add --virtual --no-cache curl ca-certificates bash + # Downloads SBT with the version given above and extracts it - curl -sL "https://piccolo.link/sbt-$SBT_VERSION.tgz" -o "sbt-$SBT_VERSION.tgz" && \ - tar -xvzf "sbt-$SBT_VERSION.tgz" -C /usr/local && \ +RUN curl -sL "https://piccolo.link/sbt-$SBT_VERSION.tgz" -o "sbt-$SBT_VERSION.tgz" +RUN tar -xvzf "sbt-$SBT_VERSION.tgz" -C /usr/local + # Compiles Ore and makes a production distribution (but not in an archive, unlike 'dist') - sbt stage && \ - mkdir -p /home/ore/prod && \ +RUN sbt stage +RUN mkdir -p /home/ore/prod + # Copy the 'stage' task result _content_ into the production directory - cp -r /home/ore/build/target/universal/stage/* /home/ore/prod && \ +RUN cp -r /home/ore/build/target/universal/stage/* /home/ore/prod + # Cleans the temporary build directory, as we don't need it in the final image - rm -rf /home/ore/build && \ +RUN rm -rf /home/ore/build + # SBT is no longer needed too - rm -rf $SBT_HOME && \ - apk del curl +RUN rm -rf $SBT_HOME +RUN apk del curl WORKDIR /home/ore/prod/bin diff --git a/docker.sh b/docker.sh deleted file mode 100755 index fe01fb4dd..000000000 --- a/docker.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# This is probably not needed anymore -# We want to connect to db/ore -JDBC_DATABASE_URL="jdbc:postgresql://db/ore" SPONGE_AUTH_URL="http://spongeauth:8000" java -jar From 7bea796162d8a65f9d2ab7b8dd67c7e5134e3ee5 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Tue, 9 Oct 2018 18:15:59 -0700 Subject: [PATCH 9/9] Add mail server to Docker Compose Signed-off-by: Jadon Fowler --- docker-compose.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index eb58ffece..5635db622 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,11 +2,12 @@ version: '3' services: app: - image: ore:1.6.8 + image: ore:1.6.16 build: . depends_on: - 'db' - 'spongeauth' + - 'mail' ports: - '9000:9000' stdin_open: true @@ -19,8 +20,12 @@ services: POSTGRES_USER: root POSTGRES_PASSWORD: '' POSTGRES_DB: ore + mail: + image: mailhog/mailhog:latest + ports: + - "8025:8025" spongeauth: - image: spongepowered/spongeauth + image: lukegb/spongeauth:latest depends_on: - 'db' ports: