-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates Dockerfile, docker-compose * Updates the copy_proto script * Updates the README, proto/README * Adds additional database up/down functions to maintain the existing volume * Adds a workflow to publish a docker to dockerhub closes: #10
- Loading branch information
Carolyn Russell
committed
Mar 18, 2021
1 parent
fe2320d
commit aadeb45
Showing
20 changed files
with
246 additions
and
335 deletions.
There are no files selected for viewing
This file contains 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,12 @@ | ||
build | ||
scripts | ||
gradle | ||
.idea | ||
.gradle | ||
.github | ||
service/docker | ||
.dockerignore | ||
.gitignore | ||
gradlew | ||
gradlew.bat | ||
.DS_STORE |
This file contains 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 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,40 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
target: run | ||
file: service/docker/Dockerfile | ||
context: . | ||
push: true | ||
tags: provenanceio/explorer-service:latest |
This file contains 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 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 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,31 @@ | ||
FROM gradle:6.8.3-jdk11 AS build | ||
RUN gradle --version && java -version | ||
WORKDIR /app | ||
|
||
# Only copy dependency-related files | ||
COPY build.gradle.kts gradle.properties settings.gradle.kts proto/build.gradle.kts buildSrc/build.gradle.kts /app/ | ||
|
||
# Only download dependencies | ||
# Eat the expected build failure since no source code has been copied yet | ||
RUN gradle clean build --no-daemon > /dev/null 2>&1 || true | ||
|
||
# Copy all files | ||
COPY service /app/service/ | ||
COPY database /app/database/ | ||
COPY buildSrc /app/buildSrc/ | ||
COPY proto /app/proto/ | ||
COPY third_party /app/third_party/ | ||
COPY .git /app/.git/ | ||
COPY build.gradle.kts gradle.properties settings.gradle.kts /app/ | ||
COPY CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md /app/ | ||
|
||
# Do the actual build | ||
RUN gradle clean build --no-daemon | ||
|
||
FROM openjdk:11-jre | ||
|
||
COPY --from=build /app/service/build/libs/*.jar /service.jar | ||
|
||
EXPOSE 8612/tcp | ||
|
||
CMD java -jar /service.jar |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
service/docker/dependencies.yml → docker/docker-compose-db.yml
This file contains 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
version: '3.5' | ||
services: | ||
postgres: | ||
image: postgres:9.6.5 | ||
image: postgres:13.2 | ||
container_name: postgres | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password1 | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- ./db-init:/docker-entrypoint-initdb.d/ | ||
- ./db-init:/docker-entrypoint-initdb.d/ |
This file contains 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,38 @@ | ||
version: '3.9' | ||
services: | ||
postgres: | ||
image: postgres:13.2 | ||
container_name: postgres | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password1 | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- ./db-init:/docker-entrypoint-initdb.d/ | ||
|
||
explorer-service: | ||
image: explorer:latest | ||
build: | ||
context: ../ | ||
dockerfile: docker/Dockerfile | ||
container_name: explorer | ||
ports: | ||
- 8612:8612 | ||
environment: | ||
- SPRING_PROFILES_ACTIVE=container | ||
- DB_USER=postgres | ||
- DB_PASS=password1 | ||
- DB_HOST=postgres | ||
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/explorer | ||
- DB_PORT=5432 | ||
- DB_NAME=explorer | ||
- DB_SCHEMA=explorer | ||
- DB_CONNECTION_POOL_SIZE=5 | ||
- SPOTLIGHT_TTL_MS=5000 | ||
- INITIAL_HIST_DAY_COUNT=14 | ||
- EXPLORER_MAINNET=false | ||
# Hits the locally running node | ||
- EXPLORER_PB_URL=http://host.docker.internal:9090 | ||
depends_on: | ||
- postgres |
This file contains 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
Oops, something went wrong.