This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
26 additions
and
23 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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
FROM gradle:4.1-jdk8 | ||
FROM gradle:4.1-jdk8-alpine | ||
|
||
ENV HOME /home/gradle | ||
# Gradle image creates a 'gradle' user, so fallback to 'root' to do initial setup | ||
USER root | ||
|
||
RUN mkdir -p $HOME/app \ | ||
&& cd $HOME/app | ||
WORKDIR $HOME/app | ||
RUN mkdir -p /opt/app \ | ||
&& mkdir -p /opt/.gradle \ | ||
&& addgroup -S -g 1001 boot \ | ||
&& adduser -D -S -G boot -u 1001 -s /bin/ash boot \ | ||
&& chown -R boot:boot /opt/app \ | ||
&& chown -R boot:boot /opt/.gradle | ||
|
||
WORKDIR /opt/app | ||
|
||
COPY .env . | ||
COPY settings.gradle . | ||
|
||
CMD ["gradle", "bootRun"] | ||
# Run the build on behalf of non-root 'boot' user | ||
USER boot | ||
|
||
# Release gradle caches if any | ||
RUN find /opt/.gradle -type f -name "*.lock" | while read f; do rm $f; done | ||
|
||
# Using gradle home where 'boot' user has full access to | ||
ENTRYPOINT ["gradle", "-g", "/opt/.gradle"] |
This file was deleted.
Oops, something went wrong.
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,9 +1,10 @@ | ||
version: "3" | ||
services: | ||
spring-boot-graphql-template-test: | ||
command: clean test | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.test | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- $HOME/.gradle/caches:/home/gradle/.gradle/caches | ||
- ${PWD}/api:/home/gradle/app/api | ||
- $HOME/.gradle/caches:/opt/.gradle/caches | ||
- ${PWD}/api:/opt/app/api |
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,13 @@ | ||
version: "3" | ||
services: | ||
spring-boot-graphql-template: | ||
command: bootRun | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- $HOME/.gradle/caches:/home/gradle/.gradle/caches | ||
- ${PWD}/api:/home/gradle/app/api | ||
- $HOME/.gradle/caches:/opt/.gradle/caches | ||
- ${PWD}/api:/opt/app/api | ||
ports: | ||
- "8080:8080" | ||
- "5005:5005" |