Skip to content

Commit

Permalink
dockerized project
Browse files Browse the repository at this point in the history
  • Loading branch information
erickmob committed Jul 11, 2020
1 parent f0eec87 commit dcec36c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.mvn
files/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ build/


#IDE metadata
**.idea/**
**.idea/**

#DS_Store metadata
**.DS_Store**
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM maven:3.6.3-adoptopenjdk-11 as build

WORKDIR /usr/src/scheduling-job/
COPY . /usr/src/scheduling-job/

RUN mvn clean package

FROM adoptopenjdk/openjdk11:alpine-jre

RUN addgroup -S spring && adduser -S spring -G spring

RUN mkdir -p /files && \
chown -R spring:spring /files

USER spring:spring


VOLUME /files

WORKDIR /app

COPY --from=build /usr/src/scheduling-job/target/scheduling-job-0.0.1-SNAPSHOT.jar /app/app.jar

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.jar"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2.2'
services:
web:
build:
context: ./
dockerfile: Dockerfile
image: web
ports:
- 8080:8080
networks:
- app

networks:
app:

0 comments on commit dcec36c

Please sign in to comment.