Skip to content

Commit d1a15db

Browse files
committed
[overture-stack#2] Docker and Compose config
Basic docker configuration, borrowing heavily from EGO. Set to run by default on port 1234 - this way it is easy to find and change when configuring multiple services on a developer's machine. overture-stack#2
1 parent 5074602 commit d1a15db

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.git
3+
target
4+
.circleci
5+
.idea

DockerFile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM openjdk:8u121-jdk-alpine
2+
3+
ARG MAVEN_VERSION=3.5.2
4+
ARG SHA=707b1f6e390a65bde4af4cdaf2a24d45fc19a6ded00fff02e91626e3e42ceaff
5+
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
6+
7+
RUN apk add --no-cache curl tar bash \
8+
&& mkdir -p /usr/share/maven /usr/share/maven/ref \
9+
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
10+
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha256sum -c - \
11+
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
12+
&& rm -f /tmp/apache-maven.tar.gz \
13+
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
14+
15+
WORKDIR /usr/src/app
16+
17+
# copy just the pom.xml and install dependencies for caching
18+
ADD pom.xml .
19+
RUN mvn verify clean --fail-never
20+
21+
ADD . .
22+
23+
RUN mvn install -DskipTests
24+
25+
FROM openjdk:8u121-jdk-alpine
26+
27+
COPY --from=0 /usr/src/app/target/*.jar .
28+
29+
EXPOSE 8081
30+
31+
CMD java -jar *.jar \
32+
--server.port=8081

docker-compose.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "3.2"
2+
services:
3+
api:
4+
build: .
5+
ports:
6+
- "1234:8081"

0 commit comments

Comments
 (0)