Skip to content

Commit c088d03

Browse files
authored
Merge pull request #1 from ExhibitFlow/dev-update
Dev update
2 parents 6097cc7 + 488ce01 commit c088d03

76 files changed

Lines changed: 5985 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Maven
2+
target/
3+
!target/reservation-service-*.jar
4+
pom.xml.tag
5+
pom.xml.releaseBackup
6+
pom.xml.versionsBackup
7+
pom.xml.next
8+
release.properties
9+
dependency-reduced-pom.xml
10+
buildNumber.properties
11+
.mvn/timing.properties
12+
.mvn/wrapper/maven-wrapper.jar
13+
14+
# IDE
15+
.idea/
16+
*.iml
17+
.vscode/
18+
.settings/
19+
.project
20+
.classpath
21+
.factorypath
22+
23+
# OS
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Git
28+
.git/
29+
.gitignore
30+
.gitattributes
31+
32+
# Documentation
33+
*.md
34+
!README.md
35+
36+
# Test reports
37+
surefire-reports/
38+
TEST-*.xml
39+
40+
# Logs
41+
*.log
42+
43+
# Temporary files
44+
*.tmp
45+
*.bak
46+
*.swp
47+
*~
48+
49+
# Database
50+
database/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
HELP.md
22
target/
3+
bin/
34
.mvn/wrapper/maven-wrapper.jar
45
!**/src/main/**/target/
56
!**/src/test/**/target/

Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Multi-stage Dockerfile for Reservation Service
2+
3+
# Stage 1: Build stage
4+
FROM maven:3.9-eclipse-temurin-17-alpine AS build
5+
WORKDIR /app
6+
7+
# Copy Maven wrapper and pom.xml first for dependency caching
8+
COPY mvnw .
9+
COPY .mvn .mvn
10+
COPY pom.xml .
11+
12+
# Download dependencies (cached if pom.xml hasn't changed)
13+
RUN mvn dependency:go-offline -B
14+
15+
# Copy source code
16+
COPY src ./src
17+
18+
# Build the application (skip tests for faster builds)
19+
RUN mvn clean package -DskipTests
20+
21+
# Stage 2: Runtime stage
22+
FROM eclipse-temurin:17-jre-alpine
23+
WORKDIR /app
24+
25+
# Add non-root user for security
26+
RUN addgroup -S spring && adduser -S spring -G spring
27+
USER spring:spring
28+
29+
# Copy the built artifact from build stage
30+
COPY --from=build /app/target/reservation-service-*.jar app.jar
31+
32+
# Expose the application port
33+
EXPOSE 8080
34+
35+
# Set JVM options for containerized environment
36+
ENV JAVA_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -XX:+UseG1GC"
37+
38+
# Health check
39+
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
40+
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
41+
42+
# Run the application
43+
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]

0 commit comments

Comments
 (0)