From 2bd7fabb50543f01b6924232dce5f7d40b7acd40 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Sun, 7 Jan 2018 12:28:54 -0800 Subject: [PATCH] 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 +