Skip to content

Commit 3f296dd

Browse files
author
Mario Luan Santos de Souza
committed
fixes #3: dockerize app
1 parent d2031e3 commit 3f296dd

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APP_PATH=/home/gradle/java-sorting-algorithms

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM gradle:4.5.0-jdk8-alpine
2+
3+
ENV USER gradle
4+
ENV APP_PATH /home/gradle/java-sorting-algorithms
5+
6+
RUN mkdir $APP_PATH \
7+
&& chown $USER $APP_PATH

README-docker.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# README-docker.md
2+
3+
**Pre-requisites:**
4+
- docker (17.12.0-ce)
5+
- docker-compose (1.18.0)
6+
7+
## Test
8+
```bash
9+
docker-compose run gradle gradle clean cobertura check
10+
```
11+
12+
## Build
13+
```bash
14+
docker-compose run gradle gradle clean assemble
15+
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Import the files [code-style.xml](code-style.xml) and [formatter.xml](formatter.
1717

1818
## Test
1919
```bash
20-
gradle clean coberturaCheck check
20+
gradle clean cobertura check
2121
# Test summary will be located at `build/reports/tests/test/index.html`
2222
# Coverage report will be located at `build/reports/cobertura/index.html`.
2323
# Code style issues report will be located at `build/reports/checkstyle/main.html`

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
services:
3+
gradle:
4+
build: .
5+
working_dir: $APP_PATH
6+
volumes:
7+
- ./config:$APP_PATH/config
8+
- ./src:$APP_PATH/src
9+
- ./build.gradle:$APP_PATH/build.gradle
10+
- ./settings.gradle:$APP_PATH/settings.gradle
11+
- gradle_cache:/home/gradle/.gradle
12+
command: gradle --help
13+
volumes:
14+
gradle_cache:

0 commit comments

Comments
 (0)