Skip to content

Commit 3b64bc0

Browse files
committed
[CONFIG] Docker added.
1 parent 58b8c3e commit 3b64bc0

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
###############################################################################
2+
FROM gradle:8.0.2-jdk19-alpine as development
3+
4+
RUN apk add --update --no-cache make
5+
6+
WORKDIR /app
7+
8+
###############################################################################
9+
FROM development as builder
10+
11+
WORKDIR /app
12+
13+
## Copy sources to builder stage
14+
COPY ./ /app
15+
16+
## build
17+
RUN chmod +x gradlew
18+
RUN gradle --console=verbose build
19+
20+
###############################################################################
21+
FROM builder as testing

compose.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
projecteuler-java:
3+
image: projecteuler-java:latest
4+
build:
5+
context: .
6+
target: testing
7+
environment:
8+
LOG_LEVEL: ${LOG_LEVEL:-info} ## (1) ## info | debug
9+
BRUTEFORCE: ${BRUTEFORCE:-false} ## (1) ## true | false
10+
volumes:
11+
- ./build:/app/build
12+
profiles: ["testing"]
13+
14+
projecteuler-java-dev:
15+
image: projecteuler-java:dev
16+
build:
17+
context: .
18+
target: development
19+
environment:
20+
LOG_LEVEL: ${LOG_LEVEL:-info} ## (1) ## info | debug
21+
BRUTEFORCE: ${BRUTEFORCE:-false} ## (1) ## true | false
22+
volumes:
23+
- ./:/app
24+
profiles: ["development"]
25+
26+
## REFERENCES:
27+
## (1) Passing Environment variable with fallback value:
28+
## https://stackoverflow.com/a/70772707/6366150
29+
##

0 commit comments

Comments
 (0)