-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 907 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM maven:3.8.6-openjdk-18-slim
# Create a directory for the application repository
RUN mkdir /app-repo
# Copy the project files into the container
ADD . /app-repo/
WORKDIR /app-repo
# Clean and package the application
RUN mvn clean
RUN mvn package spring-boot:repackage
# Expose the application port
EXPOSE 3003
# Environment variables (can be overridden when running the container)
# SPRING_PROFILES_ACTIVE: Specifies the active Spring Boot profile (e.g., gessi)
# DB_USERNAME: GraphDB Database username (set via environment variable for security)
# DB_PASSWORD: GraphDB Database password (set via environment variable for security)
# REPO_NAME: Name of the GraphDB repository
ENV SPRING_PROFILES_ACTIVE=docker
ENV DB_USERNAME=${DB_USERNAME}
ENV DB_PASSWORD=${DB_PASSWORD}
ENV REPO_NAME=${REPO_NAME}
# Run the Spring Boot application
ENTRYPOINT ["java", "-jar", "./target/repo-0.0.1-SNAPSHOT.jar"]