Skip to content

Commit

Permalink
Some work on Docker based on what Phase made on his PR The
Browse files Browse the repository at this point in the history
 Ore container may have to be manually configured for some stuff
  • Loading branch information
RedNesto committed Aug 28, 2018
1 parent 72cd417 commit 62e8d65
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 19 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
38 changes: 23 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
FROM openjdk:8-jdk-alpine

MAINTAINER Jadon Fowler <[email protected]>
LABEL maintainer="Jadon Fowler <[email protected]>"

# 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"]
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2"
version: '2'

services:
app:
Expand All @@ -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'

0 comments on commit 62e8d65

Please sign in to comment.