-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 835 Bytes
/
Dockerfile
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
31
32
33
34
# OpenJDK 21
FROM openjdk:21
VOLUME /tmp
# Expose the application port
EXPOSE 8080
# Define JAR_FILE variable
ARG JAR_FILE=target/medium-articles-0.0.1-SNAPSHOT.jar
# ENV variables for MASTER
ENV DATABASE_HOST=${DATABASE_HOST}
ENV DATABASE_PORT=${DATABASE_PORT}
ENV DATABASE_NAME=${DATABASE_NAME}
ENV DATABASE_USERNAME=${DATABASE_USERNAME}
ENV DATABASE_PASSWORD=${DATABASE_PASSWORD}
# ENV variables for REPLICA
ENV REPLICA_HOST=${REPLICA_HOST}
ENV REPLICA_PORT=${REPLICAE_PORT}
ENV REPLICA_NAME=${REPLICA_NAME}
ENV REPLICA_USERNAME=${REPLICA_USERNAME}
ENV REPLICA_PASSWORD=${REPLICA_PASSWORD}
# ENV variables for REDIS
ENV REDIS_HOST=${REDIS_HOST}
ENV REDIS_PORT=${REDIS_PORT}
# Copy the JAR file to the container
ADD ${JAR_FILE} app.jar
# Running command, specify resource constraints
ENTRYPOINT ["java", "-jar", "/app.jar"]