-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
39 lines (32 loc) · 1.21 KB
/
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
35
36
37
38
39
FROM docker.io/eclipse-temurin:21-jdk-alpine as builder
WORKDIR /app
ADD . /tmp
ARG APP_VERSION="invalid"
RUN cd /tmp && \
chmod +x gradlew && \
./gradlew deploy -P version=$APP_VERSION --no-daemon && \
mv build/libs/CapivaraBot.jar /app && \
rm -rf /tmp/*
FROM docker.io/eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=builder /app .
ENV JAVA_ARGS="-Xmx350M"
ENV LOG_DIRECTORY="/app/logs"
ENV DISCORD_TOKEN="invalid"
ENV CURUPIRA_RESET="true"
ENV LOG_CHANNEL_ID="invalid"
ENV DATABASE_DRIVER="org.postgresql.Driver"
ENV DATABASE_DIALECT="org.hibernate.dialect.PostgreSQL95Dialect"
ENV DATABASE_URL="jdbc:postgresql://localhost:5432/capivara"
ENV DATABASE_USERNAME="database-username"
ENV DATABASE_PASSWORD="database-password"
ENTRYPOINT java ${JAVA_ARGS} -jar CapivaraBot.jar \
--token=${DISCORD_TOKEN} \
--curupira.reset=${CURUPIRA_RESET} \
--log.directory=${LOG_DIRECTORY} \
--log.channel.id=${LOG_CHANNEL_ID} \
--spring.datasource.driverClassName=${DATABASE_DRIVER} \
--spring.jpa.database-platform=${DATABASE_DIALECT} \
--spring.datasource.url=${DATABASE_URL} \
--spring.datasource.username=${DATABASE_USERNAME} \
--spring.datasource.password=${DATABASE_PASSWORD}