forked from richkmeli/Richkware-Manager-Server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 811 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (21 loc) · 811 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
29
30
FROM tomcat:9-jdk17
LABEL maintainer="Richk <richkmeli@gmail.com>"
ENV CATALINA_HOME=/usr/local/tomcat
WORKDIR /usr/local/tomcat
# Remove default webapps to keep image clean
RUN rm -rf webapps/*
# Copy pre-built WAR (built on host) as ROOT.war so app is served at '/'
COPY target/Richkware-Manager-Server.war webapps/ROOT.war
# Add curl for healthcheck
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
EXPOSE 8080
ENV DB_HOST=db \
DB_PORT=5432 \
DB_USERNAME=richk \
DB_PASSWORD=changeme \
ENCRYPTION_KEY=changeme \
DEBUG_MODE=false \
SPRING_PROFILES_ACTIVE=docker
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1
CMD ["catalina.sh", "run"]