Skip to content

Commit

Permalink
Add Dockerfile and compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
GravityDarkLab committed Jan 29, 2024
1 parent 20bc2ff commit dbaff21
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM eclipse-temurin:17-jdk-focal

WORKDIR /app

COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN chmod +x mvnw
RUN ./mvnw dependency:go-offline

COPY src ./src

CMD ["./mvnw", "spring-boot:run"]
30 changes: 30 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
version: '3.8'

services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
volumes:
- .:/app
- maven_cache:/root/.m2
environment:
SPRING_PROFILES_ACTIVE: dev
JAVA_OPTS: "-Xmx512m -Xms256m"
networks:
- app-network
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health/health" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s

networks:
app-network:
driver: bridge

volumes:
maven_cache:
driver: local

0 comments on commit dbaff21

Please sign in to comment.