-
-
Notifications
You must be signed in to change notification settings - Fork 22
WIP: Start on Docker Integration #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
phase
wants to merge
16
commits into
SpongePowered:staging
Choose a base branch
from
phase:docker
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2bd7fab
Start on Docker Integration
phase 5bb3dd0
Merge branch 'master' into docker
phase a0c3ab0
Reset Ore password & Change Docker Image
phase b269549
Temp commit
phase c60b667
Merge branch 'master' into docker
phase 94e601c
it works
8b5c4cb
Merge branch 'master' into docker
phase 024ff5e
Connect Ore to the Docker DB
phase 72cd417
Merge branch 'master' into docker
phase 62e8d65
Some work on Docker based on what Phase made on his PR The
RedNesto c525e5e
Proper SBT setup for building the image
RedNesto 1fe54ec
Merge pull request #1 from RedNesto/red-docker
phase 63d2942
Merge branch 'master' into docker
phase 3ce6f23
Fix APK dependencies & ignore Hydra in Docker
phase d1e848a
Merge branch 'master' into docker
phase 7bea796
Add mail server to Docker Compose
phase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| FROM postgres:9.6 | ||
|
|
||
| COPY init.sql /docker-entrypoint-initdb.d/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| create database spongeauth; | ||
| create role spongeauth with login password 'spongeauth'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
|
|
||
| !app/ | ||
|
|
||
| !conf/ | ||
| # This is created in the Dockerfile | ||
| conf/application.conf | ||
|
|
||
| !OreTestPlugin/ | ||
|
|
||
| !project/ | ||
| project/target/ | ||
| project/project/ | ||
| # Hydra Scala Compiler | ||
| project/hydra.sbt | ||
|
|
||
| !public/ | ||
|
|
||
| !scripts/ | ||
|
|
||
| !build.sbt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # This Dockerfile is designed to be used for production | ||
| FROM openjdk:8-jdk-alpine | ||
|
|
||
| LABEL maintainer="Jadon Fowler <jadonflower@gmail.com>" | ||
|
|
||
| # 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 . ./ | ||
|
|
||
| # 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 \ | ||
| APPLICATION_SECRET="some_secret" | ||
|
|
||
| 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.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 | ||
| 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') | ||
| RUN sbt stage | ||
| RUN mkdir -p /home/ore/prod | ||
|
|
||
| # Copy the 'stage' task result _content_ into the production directory | ||
| 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 | ||
| RUN rm -rf /home/ore/build | ||
|
|
||
| # SBT is no longer needed too | ||
| RUN rm -rf $SBT_HOME | ||
| RUN apk del curl | ||
|
|
||
| WORKDIR /home/ore/prod/bin | ||
|
|
||
| # Ore runs on port 9000 | ||
| EXPOSE 9000 | ||
|
|
||
| CMD ["./ore"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| version: '3' | ||
|
|
||
| services: | ||
| app: | ||
| image: ore:1.6.16 | ||
| build: . | ||
| depends_on: | ||
| - 'db' | ||
| - 'spongeauth' | ||
| - 'mail' | ||
| ports: | ||
| - '9000:9000' | ||
| stdin_open: true | ||
| db: | ||
| build: '.docker/db/' | ||
| restart: always | ||
| ports: | ||
| - '5432:5432' | ||
| environment: | ||
| POSTGRES_USER: root | ||
| POSTGRES_PASSWORD: '' | ||
| POSTGRES_DB: ore | ||
| mail: | ||
| image: mailhog/mailhog:latest | ||
| ports: | ||
| - "8025:8025" | ||
| spongeauth: | ||
| image: lukegb/spongeauth:latest | ||
| depends_on: | ||
| - 'db' | ||
| ports: | ||
| - '8000:8000' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.