39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
FROM eclipse-temurin:21-jdk-alpine
|
|
|
|
RUN apk add --no-cache curl tzdata
|
|
|
|
# Install supercronic for cron scheduling
|
|
RUN curl -fsSL -o /usr/local/bin/supercronic \
|
|
https://github.com/aptible/supercronic/releases/download/v0.2.30/supercronic-linux-amd64 \
|
|
&& chmod +x /usr/local/bin/supercronic
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy source files
|
|
COPY src/ /app/src/
|
|
COPY export_real_words_with_hints.csv /app/export_real_words_with_hints.csv
|
|
COPY compile.sh /app/compile.sh
|
|
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
|
COPY crontab /app/crontab
|
|
|
|
# Compile Java code
|
|
RUN chmod +x /app/compile.sh && \
|
|
mkdir -p /app/target && \
|
|
cp src/puzzle/postgresql-42.7.8.jar /app/target/ && \
|
|
javac -cp /app/target/postgresql-42.7.8.jar -d /app/target src/puzzle/*.java
|
|
|
|
# Create output directory
|
|
RUN mkdir -p /data/puzzles
|
|
|
|
ENV TZ=Europe/Amsterdam
|
|
ENV OUT_DIR=/data/puzzles
|
|
ENV PUZZLES_PER_DAY=3
|
|
ENV THEME_FILTER=true
|
|
ENV THEME_MIN_SCORE=0.6
|
|
|
|
VOLUME ["/data"]
|
|
|
|
RUN chmod +x /app/docker-entrypoint.sh
|
|
|
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|